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
From @sachinpachori on Wednesday, December 27, 2017 3:19:02 PM
This is a common scenario where your DTO/viewmodel could be different from the Entities. In this case how to use this JSONPatch with ApplyTo function. If possible, I think you should work on providing this feature.
It is almost useless without this feature.
void Patch(JsonPatchDocument patch)
{
patch.ApplyTo(userEntity);
}
I cannot use it this way because my UserEntity has collection of Roles and anybody can "patch" it.
We need to separate the list of fields in patch from the entity.
Hi,
is there any new solution to perform this kind of actions? I've two scenarios for this where I'm getting stuck:
I have a gateway that first receives the PatchDocument and then propagates request for proper service through it's SDK. Gateway type is JsonPatchDocument<Gateway.ContactDTO> and service is JsonPatchDocument<Service.ContactDTO>. Any elegant way of converting one to another?
In service we want to receive the JsonPatchDocument<Service.ContactDTO> but apply it to Service.Domain.Contact. Is this possible without getting domain object, mapping to DTO, applying Patch and converting to Domain object again?
ghost
locked as resolved and limited conversation to collaborators
Dec 4, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesquestion
From @sachinpachori on Wednesday, December 27, 2017 3:19:02 PM
This is a common scenario where your DTO/viewmodel could be different from the Entities. In this case how to use this JSONPatch with ApplyTo function. If possible, I think you should work on providing this feature.
Copied from original issue: aspnet/JsonPatch#127
The text was updated successfully, but these errors were encountered: