I'm using dapper with dynamic return model objects and I'd like to configure it to 'skip' fields which are null.
For instance instead of :
[0]: {DapperRow, Type = 'PHYS', Street1 = NULL, Street2 = NULL, State = CO}
I'd like Dapper to return
[0]: {DapperRow, Type = 'PHYS', State = CO}
This would be functionally similiar to JSON.Net's 'NullValueHandling setting' functionality.
Is this possible without altering the underlying SQL Query?
The benefit would be decreasing the size of my (eventual) JSON object that is serialized from Dapper's result set and gets returned to an API client.
(This is a different question than this one, as I am using dynamic model classes)