Thalnos
Binding case-insensitive query parameter to string enum in .NET 9 Minimal API
oh I think I understand why its not working.
Microsoft.AspNetCore.Http.Json.JsonOption
holds PropertyNameCaseInsensitive = true
but the fields in an enum aren't properties. You can only make property binding case insensitive it seems. Consider changing your enum to a class,record or struct to make it case insensitive5 replies
Binding case-insensitive query parameter to string enum in .NET 9 Minimal API
one way to do this is to create a custom modelbinder https://learn.microsoft.com/en-us/aspnet/core/mvc/advanced/custom-model-binding?view=aspnetcore-9.0
5 replies
Prevent Visual Studio from adding NotImplementedException when generating method
Ctrl + L might be something IDE specific that I dont know, but what works across all IDEs to do this is Shift + Delete, that will delete the line your cursor is in
13 replies
Prevent Visual Studio from adding NotImplementedException when generating method
but why? its very helpful to generate the
throw new NotImplementedException()
because until you've implemented thats exactly what it should do, to point out that it's missing an implementation. If you have empty methods in your code and accidentally forget to edit them then you could run into unexpected behaviours13 replies