Tidbits
-
Blazor + HTML minification
Blazor tracks local state through HTML comments. HTML minification should exclude Blazor: comments to avoid rendering the application unusable.
-
Async locking
Async by design may not resume on its original thread which can result in deadlocks. Locking needs to occur through a shared resource, a semaphore.
-
LINQ .Distinct on ordered results
If you've noticed that your ordered results become unordered after materializing with .Distrinct(), give .GroupBy() a try.
-
WebApi [FromBody]
Web Api's [FromBody] seems to confuse a lot of developers. By default Web Api will only look for primitve types (string, int, etc) in the uri.
For actions using primitive types in the body such as Post(int userId) we must tell the Web Api binder to look at the body of the request, not the uri, by decorating arguments with [FromBody].