Skip to content

A framework for building JSON:API compliant REST APIs using ASP.NET and Entity Framework Core.

License

Notifications You must be signed in to change notification settings

json-api-dotnet/JsonApiDotNetCore

Folders and files

NameName
Last commit message
Last commit date
Feb 18, 2018
Jun 14, 2018
Jul 20, 2018
Jul 20, 2018
Dec 16, 2017
Mar 25, 2018
Jun 12, 2018
Jul 5, 2018
Apr 22, 2018
Jun 12, 2018
Mar 25, 2018
Mar 20, 2017
Aug 10, 2017
Jun 15, 2018
Jul 5, 2018
Mar 25, 2018
Nov 2, 2017

Repository files navigation

JSON API .Net Core

Build status Travis NuGet Join the chat at https://gitter.im/json-api-dotnet-core/Lobby FIRST-TIMERS

A framework for building json:api compliant web APIs. The ultimate goal of this library is to eliminate as much boilerplate as possible by offering out-of-the-box features such as sorting, filtering and pagination. You just need to focus on defining the resources and implementing your custom business logic. This library has been designed around dependency injection making extensibility incredibly easy.

Getting Started

These are some steps you can take to help you understand what this project is and how you can use it:

Related Projects

Examples

See the examples directory for up-to-date sample applications. There is also a Todo List App that includes a JADNC API and an EmberJs client.

Installation And Usage

See the documentation for detailed usage.

Models

public class Article : Identifiable
{ 
    [Attr("name")]
    public string Name { get; set; }
}

Controllers

public class ArticlesController : JsonApiController<Article>
{
    public ArticlesController(
        IJsonApiContext jsonApiContext,
        IResourceService<Article> resourceService) 
    : base(jsonApiContext, resourceService) { }
}

Middleware

public class Startup 
{
    public IServiceProvider ConfigureServices(IServiceCollection services) {
        services.AddJsonApi<AppDbContext>();
        // ...
    }

    public void Configure(IApplicationBuilder app)  {
        app.UseJsonApi()
        // ...
    }
}