json-patch

JsonPatch in an Angular/.NET Web API project

守給你的承諾、 提交于 2019-12-06 12:52:10
I'm utilizing KevinDockx's JsonPatch extension for Visual Studio. My project uses .NET Web API (not Core) and Angular (6) . .Net Web API doesn't support the JsonPatchDocument namespace, thus the need for KevinDock's JsonPatch extension. I'm reading through his documentation here: https://github.com/KevinDockx/JsonPatch/blob/master/README.md JsonPatch consists of two parts: On the client (consumer of the API) : the JsonPatchDocument / JsonPatchDocument class to build what's essentially a change set to be applied to your object on your API side. At (Web) API level : an ApplyTo method to apply

How can I create a JsonPatchDocument from comparing two c# objects?

馋奶兔 提交于 2019-12-02 17:39:09
Given I have two c# objects of the same type, I want to compare them to create a JsonPatchDocument. I have a StyleDetail class defined like this: public class StyleDetail { public string Id { get; set; } public string Code { get; set; } public string Name { get; set; } public decimal OriginalPrice { get; set; } public decimal Price { get; set; } public string Notes { get; set; } public string ImageUrl { get; set; } public bool Wishlist { get; set; } public List<string> Attributes { get; set; } public ColourList Colours { get; set; } public SizeList Sizes { get; set; } public ResultPage<Style>

Modify @OneToMany entity in Spring Data Rest without its repository

浪子不回头ぞ 提交于 2019-11-30 12:14:33
问题 In my project I use object of type A which has OneToMany relation (orphanRemoval = true, cascade = CascadeType.ALL, fetch = FetchType.EAGER) to objects of type B . I need SpringDataRest (SDR) to store complete full A object with its B objects (children) using single one POST request. I tried several combinations in SDR, the only one which worked for me, was to create @RepositoryRestResource for object A and to create @RepositoryRestResource also for object B , but mark this ( B ) as exported

Modify @OneToMany entity in Spring Data Rest without its repository

假装没事ソ 提交于 2019-11-30 02:13:30
In my project I use object of type A which has OneToMany relation (orphanRemoval = true, cascade = CascadeType.ALL, fetch = FetchType.EAGER) to objects of type B . I need SpringDataRest (SDR) to store complete full A object with its B objects (children) using single one POST request. I tried several combinations in SDR, the only one which worked for me, was to create @RepositoryRestResource for object A and to create @RepositoryRestResource also for object B , but mark this ( B ) as exported=false (if I did not create repository out of object B at all, it would not work -> just A object would