You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a use case where I would like to be able to provide a different type for the newly returned document.
Given existing classes MyModel and MyModelNew containing only a subset of properties from MyModel. I would like to be able to call PostDocumentAsync to post a MyModelNew but return a MyModel. We support this with PatchDocumentAsync.
Using ignore null values values isn't an option because there are null values I would like to post. I could use serialization attributes but provide a new method supporting this use case would be much simpler.
I propose to add PostDocumentAsync<T, U> where T is the type to post and U the type to return in PostDocumentResponse.New, when PostDocumentsQuery.ReturnNew is specified.
I have a use case where I would like to be able to provide a different type for the newly returned document.
Given existing classes
MyModel
andMyModelNew
containing only a subset of properties fromMyModel
. I would like to be able to callPostDocumentAsync
to post aMyModelNew
but return aMyModel
. We support this withPatchDocumentAsync
.Using ignore null values values isn't an option because there are null values I would like to post. I could use serialization attributes but provide a new method supporting this use case would be much simpler.
I propose to add
PostDocumentAsync<T, U>
whereT
is the type to post andU
the type to return inPostDocumentResponse.New
, whenPostDocumentsQuery.ReturnNew
is specified.Example of use:
The text was updated successfully, but these errors were encountered: