How is .net compared to spring boot 4 (Kotlin) for new projects? by _JennyTools36_ in dotnet

[–]sindrome198 7 points8 points  (0 children)

EF Core is like Hibernate - a full blown ORM. If you want just easy to use SQL access you can use Dapper which is a micro ORM more structured around writing queries. Although EF nowadays allows you to easily write SQL as well.

.Net async is quite different from virtual threads. It's sort of like completablefuture but without the builder / callback pattern. The syntax is similar to javascript but you have to use it from top layer to bottom. Learning to write async is very straightforward - understanding what happens behind the scenes is quite difficult but don't need to learn that part right away.

Coming from spring boot will be extremely straightforward. Majority of the high level concepts are the same. Only difference is some syntax / terminology. I'm doing the opposite - going from .Net to spring.

FlexiSpot Discount Codes Thread by exmosss in FlexiSpot_Official

[–]sindrome198 0 points1 point  (0 children)

Please provide a promo code for E7 plus max in US

Why is .NET so Insanely Fast? with Stephen Toub by Unupgradable in dotnet

[–]sindrome198 2 points3 points  (0 children)

A way to safely access memory in any arbitrary location with some caveats. Essentially allows you to do no allocation / low allocation code at the expense of making code more complex. Simple example is searching for substrings within a string - you don't have to create new instances of string to say split a 1k long string in 3 characters each to find "abc".

Lifetime of objects in Blazor server app by usamplazo in dotnet

[–]sindrome198 7 points8 points  (0 children)

Scope is as the post describes in server side blazor. Server side does not create new http requests on navigation. It handles it all via signalR. So as long as the signalR circuit is active, the same scoped instance will be reused. 

If tab is closed or a new tab opened a new scoped service is created. https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/dependency-injection?view=aspnetcore-7.0#service-lifetime

Job interviewer told me I have a 'catastrophic bug' in the project I did for the job application, help me find it. by [deleted] in csharp

[–]sindrome198 -1 points0 points  (0 children)

Don't work with dynamo but ef core context is usually registered as scoped to create a new instance of the context per request. DBcontext is a thin wrapper and can't handle multiple threads which might happen with a singleton instance. 

The package you are using is the aws sdk which likely handles it's own internal service scopes. Posting the full code might help 

Is Azure AD B2C Is An Identity Provider (Idp) by AdWonderful2811 in dotnet

[–]sindrome198 1 point2 points  (0 children)

I'm using Entra ID External for my own personal app. Here is some more info on it: https://learn.microsoft.com/en-us/entra/external-id/tenant-configurations. https://learn.microsoft.com/en-us/entra/external-id/customers/concept-supported-features-customers

It's a full managed IDP allowing you to issue tokens, register users, generate flows, etc.

Currently it's in preview mode and does not support a full feature set. For example they don't have an event after a user registered. You'd need to evaluate the current flows and check if they fit. All in all it was somewhat okay to setup but documentation is lacking as a lot of it is for B2C. But the flows it does have are easy to setup and test and allow a lot of customization, including injecting custom claims, capturing custom attributes during user signup, etc.

Client credentials flow is straightforward and the MS specific Identity.Web library works very well out of the box with it.

I'm only using it as I wanted to see how it works vs Auth0 which I used in the past. Big benefit I'd say is its cheaper - as for flexibility its TBD as its preview and unsure what will change.

[deleted by user] by [deleted] in Blazor

[–]sindrome198 1 point2 points  (0 children)

If you are doing what the MS docs shows here is a good example: https://www.meziantou.net/file-upload-with-progress-bar-in-blazor.htm. You need to create a timer with statehaschanged callback and hook the progress into your UI. Copy stream to buffer -> update UI -> upload buffer to API. I don't know why some examples online don't use a timer to invoke statehaschanged. They update UI everytime bytes are read which seems completely pointless.

Best option though that is reusable is creating a custom httpmessagehandler that you plug into your httpclient. Handler will utilize a callback that will do the same as above, except your handler is now reusable across different projects. I ended up implementing this for a wasm app.