Nov 26, 2019 09:05 AM|PatriceSc|LINK
A bit like EF, ASP.NET have built in support for deserialization/serialization so that your controller code can deal directly with the object you are interested in without having to handle those details So what if you try something such as;
public async Task<ActionResult<ContactResult>> Post(ContactFormDataModel contact)
// drop the deserialization code, this is handled for you by EF
// not sure what you return
Make sure property names are matching. Yo should have a non null contact and inspect properties to see if they are populated correctly. Does it work?
Similarly you can define settings once for the whole app at startup rather than in each and every control to end up with code that just does what you need on objects and deserizalation/serialization being handled being the scene for you.