Skip to content

webbeta/NSerializer.AspNetCore

Repository files navigation

webBeta NSerializer ASP.NET Core module

Build Status GitHub license NuGet

Installation

public class Startup
{
    // ...
    
    public void ConfigureServices(IServiceCollection services)
    {
        // ...
        services.AddNSerializer();
        // ...
    }

    // ...
}

Usage

[ApiController]
[Route("[controller]")]
public class DemoController : ControllerBase
{
    private readonly NSerializer _serializer;

    public DemoController(NSerializer serializer)
    {
        _serializer = serializer;
    }

    [HttpGet("ascreated")]
    public ActionResult AsCreated()
    {
        return _serializer.SerializeAndCreated(new Demo(), "created_group");
    }

    [HttpGet("asok")]
    public ActionResult AsOk()
    {
        return _serializer.SerializeAndOk(new Demo(), "ok_group");
    }
}

Documentation

More documentation and resources at webBeta NSerializer repository.

License

MIT

About

ASP.NET Core module for webBeta.NSerializer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages