Skip to content

Instantly share code, notes, and snippets.

View zielinski-piotr's full-sized avatar

Piotr Zieliński zielinski-piotr

View GitHub Profile
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;
[HttpPatch("{id}")]
Task<IActionResult> UpdateHouse([FromBody] JsonPatchDocument<House.Patch> patchDocument, Guid id)
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers()
.AddNewtonsoftJson();
}
[
{
"op": "replace",
"path": "/name",
"value": "Green house"
},
{
"op": "add",
"path": "/rooms/-",
"value": {