Bruno Oliveira
Bruno Oliveira
@tdjastrzebski I just tested your code and you need to: * Remove the ModelBinder attribute, since your are using the `IModelBinderProvider`. ``` diff -public async Task Create([ModelBinder(typeof(VehicleModelBinder))] Vehicle vehicle) +public...
@tdjastrzebski The problem is your custom binder gets the `Kind` to decided which model should be used. If this value is coming from the JSON payload you will need to...
> Do I correctly understand that use of `[ModelBinder]` attribute and `IModelBinderProvider` is mutually exclusive? > Declarative fashion (`ModelBinder`) is more preferred. Short answer: YES. Long answer: The `ModelBinderAttribute` is...
> I am not sure if it is an option for you, but .NET 7 introduces [System.Text.Json Polymorphism](https://devblogs.microsoft.com/dotnet/announcing-dotnet-7-preview-5/#polymorphism) that simplifies your scenario. In this case you won't need a custom...
@sammychinedu2ky The issue is related to something different. Can you share your example? I very weird because the `ProblemDetailsContext` should not be marked as obsolete.
Is there a typo in your comment or it is exactly the code your are using? I am asking because it seems to have some addition parentheses ``` diff if...
So this code `problemDetailsService.WriteAsync(new { HttpContext = context });` is not compiling? Are you using .NET 7 Preview 7?
@sammychinedu2ky I just tried, and it looks like some compiler configuration because I can build the same code in _**aspnetcore**_ repo but not outside. However, I was able to build...
@sammychinedu2ky actually the blog post missed a parentheses, it should be: ``` diff if (context.RequestServices.GetService() is { } problemDetailsService) { - problemDetailsService.WriteAsync(new { HttpContext = context }); + problemDetailsService.WriteAsync(new (){...
Look like it is complaining about the [Required Property](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/required). Can you share a simple repro? I can try to understand what you are missing.