I am writing a route function which looks something like this:
public IHttpActionResult SomeRoute([FromBody] PostedData postedData)
The FromBody
attribute will convert the data posted into the route to the type specified, with any properties which it can't cast in this way being set to null.
What I'm trying to do is check whether or not there are any null properties on the data which was posted (postedData
in the example above). As I know the type, I can manually check each one, but I'd like to be able to implement such a check in a more generic way, and I'm wondering if this is possible.