Simplify.Web.Json 2.4.0

dotnet add package Simplify.Web.Json --version 2.4.0                
NuGet\Install-Package Simplify.Web.Json -Version 2.4.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="Simplify.Web.Json" Version="2.4.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Simplify.Web.Json --version 2.4.0                
#r "nuget: Simplify.Web.Json, 2.4.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 Simplify.Web.Json as a Cake Addin
#addin nuget:?package=Simplify.Web.Json&version=2.4.0

// Install Simplify.Web.Json as a Cake Tool
#tool nuget:?package=Simplify.Web.Json&version=2.4.0                

Simplify.Web.Json

Nuget Version Nuget Download Build PackageLibraries.io dependency status for latest release CodeFactor Grade Platform PRs Welcome

Simplify.Web.Json is a package which provides JSON serialization/deserialization for Simplify.Web web-framework controllers using Newtonsoft.Json.

Quick Start

Sending JSON to client

If the controller returns Json response class object, then the Framework execution will be stopped, object will be parsed to JSON string and sent to client

public class MyController : Controller2
{
    public ControllerResponse Invoke()
    {
        ...
        return new Json(myObj);
    }
}

Getting JSON from client

Registering binder
public void Configuration(IApplicationBuilder app)
{
    ...
    HttpModelHandler.RegisterModelBinder<JsonModelBinder>();

    app.UseSimplifyWeb();
}

public void ConfigureServices(IServiceCollection services)
{
    ...
    HttpModelHandler.ModelBindersTypes.Clear(); // This is required to remove built-in JSON model binder (based on System.Text.Json)
    DIContainer.Current.RegisterJsonModelBinder();
    ...
}
Accessing model
Asynchronous
public class MyController : Controller2<MyModel>
{
    public async Task<ControllerResponse> Invoke()
    {
        await ReadModelAsync();

        Model.
    }
}
Synchronous

JSON string will be deserialized to the controller model on first model access

public class MyController : Controller2<MyModel>
{
    public ControllerResponse Invoke()
    {
        Model.
    }
}

Contributing

There are many ways in which you can participate in the project. Like most open-source software projects, contributing code is just one of many outlets where you can help improve. Some of the things that you could help out with are:

  • Documentation (both code and features)
  • Bug reports
  • Bug fixes
  • Feature requests
  • Feature implementations
  • Test coverage
  • Code quality
  • Sample applications

Additional extensions to Simplify.Web live in their own repositories on GitHub. For example:

License

Licensed under the GNU LESSER GENERAL PUBLIC LICENSE

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  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 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.4.0 141 6/5/2024
2.4.0-pre01 102 6/1/2024
2.3.1 398 12/20/2023
2.3.0 247 8/20/2023
2.2.5 375 3/11/2023
2.2.4 398 11/30/2022
2.2.3 625 5/18/2022
2.2.2 5,558 11/24/2021
2.2.1 590 4/26/2021
2.2.0 503 3/23/2021
2.1.3 497 2/28/2021
2.1.2 626 10/26/2020
2.1.1 698 4/29/2020
2.1.0 642 1/30/2020
2.0.1 620 1/27/2020
2.0.0 666 12/22/2019
2.0.0-pre02 434 12/17/2019
2.0.0-pre01 315 8/24/2019
1.4.0 716 10/21/2019
1.3.0 629 10/20/2019
1.2.4 663 9/28/2019
1.2.3 637 9/3/2019
1.2.2 649 8/25/2019
1.2.1 620 8/22/2019
1.2.0 852 1/3/2019
1.1.3 1,103 5/9/2018
1.1.2 1,044 8/23/2017
1.1.1 1,367 11/4/2016
1.1.0 1,041 10/7/2016
1.0.0 1,040 8/26/2016
0.9.0 1,063 8/23/2016