ASP.NET Core Pitfalls – Null Models in Post Requests by @RJPeres75 weblogs.asp.net
Sometimes, when AJAX posting to a controller, you may get a null model. Why?
Let’s exclude the obvious – you didn’t send a null payload. The most typical reason is, the serializer could not deserialize the payload into the target type, and it just silently sets it to null, but no exception is thrown. Take this example:
Report Story
Leave Your Comment