GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Marusyk/Simple.HttpPatch: Simple.HttpPatch implementation for .NET to easily allow & apply partial REST-ful service (through Web API) using Http Patch

BranchesTags
Open more actions menu

Latest commit

 

History

52 Commits
52 Commits

Folders and files

NameName
Last commit message
Last commit date
samples/Simple.HttpPatch.Samples
samples/Simple.HttpPatch.Samples
 
 
src/Simple.HttpPatch
src/Simple.HttpPatch
 
 
tests/Simple.HttpPatch.Tests
tests/Simple.HttpPatch.Tests
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
CODEOFCONDUCT.md
CODEOFCONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
HttpPatch.png
HttpPatch.png
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
Simple.HttpPatch.sln
Simple.HttpPatch.sln
 
 
build.cake
build.cake
 
 
build.ps1
build.ps1
 
 
build.sh
build.sh
 
 

Repository files navigation

HttpPatch

AppVeyor GitHub (pre-)release NuGet Pre Release NuGet License contributions welcome

Simple.HttpPatch Stand With Ukraine

Simple.HttpPatch is implementation for .NET (Full framework and Core) to easily allow & apply partial RESTful service (through Web API) using HTTP PATCH method.

Installation

You can install the latest version via NuGet.

PM> Install-Package Simple.HttpPatch

How to use

See samples folder to learn of to use this library with ASP.NET Core.

Patch a single entity

[HttpPatch]
public Person Patch([FromBody] Patch<Person> personPatch)
{
    var person = _repo.GetPersonById(1);
    personPatch.Apply(person);
    return person;
}

To exclude properties of an entity while applying the changes to the original entity use PatchIgnoreAttribute. When your property is a reference type (which allows null) but you don't want that null overwrites your previous stored data then use PatchIgnoreNullAttribute

public class Person
{
    public int Id { get; set; }
    [PatchIgnore]
    public string Name { get; set; }
    public int? Age { get; set; }
    [PatchIgnoreNull]
    public DateTime BirthDate { get; set; }
}

Note: The property with name Id is excluded by default

For firewalls that don't support PATCH see this issue

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Simple.HttpPatch implementation for .NET to easily allow & apply partial REST-ful service (through Web API) using Http Patch

Topics

hacktoberfesthttp-patchjsonpatchrestrestful-apiwebapi

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

21 stars

Watchers

2 watching

Forks

7 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.