This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Threading.Tasks; | |
| using AutoMapper; | |
| using JSONPatchTutorial.Contract.Requests; | |
| using JSONPatchTutorial.Data; | |
| using Microsoft.AspNetCore.JsonPatch; | |
| using Microsoft.EntityFrameworkCore; | |
| using DataModelHouse = JSONPatchTutorial.Domain.House; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [HttpPatch("{id}")] | |
| Task<IActionResult> UpdateHouse([FromBody] JsonPatchDocument<House.Patch> patchDocument, Guid id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void ConfigureServices(IServiceCollection services) | |
| { | |
| services.AddControllers() | |
| .AddNewtonsoftJson(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "op": "replace", | |
| "path": "/name", | |
| "value": "Green house" | |
| }, | |
| { | |
| "op": "add", | |
| "path": "/rooms/-", | |
| "value": { |