https://github.com/webbeta/nserializer.aspnetcore
ASP.NET Core module for webBeta.NSerializer
https://github.com/webbeta/nserializer.aspnetcore
Last synced: 2 months ago
JSON representation
ASP.NET Core module for webBeta.NSerializer
- Host: GitHub
- URL: https://github.com/webbeta/nserializer.aspnetcore
- Owner: webbeta
- License: mit
- Created: 2020-04-05T18:58:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-20T04:49:53.000Z (almost 5 years ago)
- Last Synced: 2025-03-04T14:49:37.942Z (over 1 year ago)
- Language: C#
- Homepage:
- Size: 39.1 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# webBeta NSerializer ASP.NET Core module
[](https://travis-ci.com/webbeta/NSerializer.AspNetCore)
[](LICENSE)
[](http://www.nuget.org/packages/webBeta.NSerializer.AspNetCore)
## Installation
```csharp
public class Startup
{
// ...
public void ConfigureServices(IServiceCollection services)
{
// ...
services.AddNSerializer();
// ...
}
// ...
}
```
## Usage
```csharp
[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](https://github.com/webbeta/NSerializer) repository.
## License
[MIT](LICENSE)