Tingle.AspNetCore.JsonPatch.NewtonsoftJson
4.14.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Tingle.AspNetCore.JsonPatch.NewtonsoftJson --version 4.14.0
NuGet\Install-Package Tingle.AspNetCore.JsonPatch.NewtonsoftJson -Version 4.14.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Tingle.AspNetCore.JsonPatch.NewtonsoftJson" Version="4.14.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Tingle.AspNetCore.JsonPatch.NewtonsoftJson --version 4.14.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Tingle.AspNetCore.JsonPatch.NewtonsoftJson, 4.14.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Tingle.AspNetCore.JsonPatch.NewtonsoftJson as a Cake Addin #addin nuget:?package=Tingle.AspNetCore.JsonPatch.NewtonsoftJson&version=4.14.0 // Install Tingle.AspNetCore.JsonPatch.NewtonsoftJson as a Cake Tool #tool nuget:?package=Tingle.AspNetCore.JsonPatch.NewtonsoftJson&version=4.14.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Tingle.AspNetCore.JsonPatch.NewtonsoftJson
When performing patch operations, it is very likely that some updates to the model may try to modify or remove immutable types and thus there is a need to ensure that this is not the case before committing the changes to the persistence layer such as a database.
A sample usage of this functionality is shown below:
public class TestClass
{
[Key]
public string Id { get; set; }
[Range(18, 65)]
public int Age { get; set; }
}
public class TestController : ControllerBase
{
[HttpPost("{id}")]
public async Task<IActionResult> UpdateAsync([FromRoute, Required] string id, [FromBody] JsonPatchDocument<TestClass> model)
{
// Fetch the object that needs to be patched from your persistence layer e.g. database
var test = await GetObjectFromDbAsync(id);
// update the template
model.ApplyToSafely(template, ModelState, new List<string> { "Id" });
if (!ModelState.IsValid) return ValidationProblem();
// validate the resulting model
if (!TryValidateModel(test)) return ValidationProblem();
// other code omitted for brevity
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Microsoft.AspNetCore.Mvc.NewtonsoftJson (>= 6.0.0)
-
net7.0
- Microsoft.AspNetCore.Mvc.NewtonsoftJson (>= 7.0.0)
-
net8.0
- Microsoft.AspNetCore.Mvc.NewtonsoftJson (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
5.0.0 | 86 | 11/19/2024 |
4.14.1 | 124 | 10/14/2024 |
4.14.0 | 199 | 9/16/2024 |
4.13.0 | 321 | 8/13/2024 |
4.12.0 | 123 | 8/7/2024 |
4.11.2 | 135 | 7/15/2024 |
4.11.1 | 157 | 6/26/2024 |
4.11.0 | 134 | 6/6/2024 |
4.10.1 | 121 | 6/5/2024 |
4.10.0 | 162 | 5/27/2024 |
4.9.0 | 136 | 5/16/2024 |
4.8.0 | 152 | 5/5/2024 |
4.7.0 | 190 | 3/25/2024 |
4.6.0 | 174 | 3/8/2024 |
4.5.0 | 241 | 11/22/2023 |
4.4.1 | 181 | 11/20/2023 |
4.4.0 | 139 | 11/15/2023 |
4.3.0 | 297 | 10/18/2023 |
4.2.2 | 285 | 9/20/2023 |
4.2.1 | 334 | 8/4/2023 |
4.2.0 | 334 | 5/31/2023 |
4.1.1 | 172 | 5/26/2023 |
4.1.0 | 176 | 5/22/2023 |
4.0.0 | 392 | 3/14/2023 |
2.5.0 | 595 | 11/21/2022 |
2.4.2 | 986 | 7/25/2022 |
2.4.1 | 2,070 | 3/22/2022 |
2.4.0 | 3,461 | 11/10/2021 |
2.3.1 | 2,206 | 9/20/2021 |
2.3.0 | 1,139 | 7/22/2021 |