Giter Site home page Giter Site logo

tristargod / jsonapidotnetcore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from json-api-dotnet/jsonapidotnetcore

0.0 1.0 0.0 12.92 MB

JSON:API Framework for ASP.NET Core

Home Page: https://www.jsonapi.net

License: MIT License

C# 99.73% PowerShell 0.19% JavaScript 0.03% XSLT 0.05%

jsonapidotnetcore's Introduction

JsonApiDotNetCore

A framework for building JSON:API compliant REST APIs using .NET Core and Entity Framework Core. Includes support for Atomic Operations.

Build Coverage NuGet Chat FIRST-TIMERS

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 JsonApiDotNetCore API and an EmberJs client.

Installation and Usage

See our documentation for detailed usage.

Models

public class Article : Identifiable
{
    [Attr]
    public string Name { get; set; }
}

Controllers

public class ArticlesController : JsonApiController<Article>
{
    public ArticlesController(IJsonApiOptions options, ILoggerFactory loggerFactory,
        IResourceService<Article> resourceService,)
        : base(options, loggerFactory, resourceService)
    {
    }
}

Middleware

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

    public void Configure(IApplicationBuilder app)
    {
        app.UseRouting();
        app.UseJsonApi();
        app.UseEndpoints(endpoints => endpoints.MapControllers());
    }
}

Compatibility

A lot of changes were introduced in v4. The following chart should help you pick the best version, based on your environment.

.NET Version EF Core Version JsonApiDotNetCore Version
.NET Core 2.x 2.x v3.x
.NET Core 3.1 3.1, 5 v4
.NET 5 5 v4

Contributing

Have a question, found a bug or want to submit code changes? See our contributing guidelines.

Trying out the latest build

After each commit to the master branch, a new prerelease NuGet package is automatically published to AppVeyor at https://ci.appveyor.com/nuget/jsonapidotnetcore. To try it out, follow the next steps:

  • In Visual Studio: Tools, NuGet Package Manager, Package Manager Settings, Package Sources
  • Open the NuGet package manager console (Tools, NuGet Package Manager, Package Manager Console)
    • Select AppVeyor JADNC as package source
    • Run command: Install-Package JonApiDotNetCore -pre

Development

To build the code from this repository locally, run:

dotnet build

Running tests locally requires access to a PostgreSQL database. If you have docker installed, this can be propped up via:

run-docker-postgres.ps1

And then to run the tests:

dotnet test

Alternatively, to build and validate the code, run all tests, generate code coverage and produce the NuGet package:

Build.ps1

jsonapidotnetcore's People

Contributors

biarity avatar bjornharrtell avatar btecu avatar coolgoose avatar crfloyd avatar diegobrum avatar dnperfors avatar fdlane avatar janmattner avatar jaredcnance avatar jasolko avatar jfhs avatar jonnolen avatar joshhubers avatar lheiskan avatar maurei avatar medokin avatar milosloub avatar mrnkr avatar nullvoxpopuli avatar nwise avatar piotr-brzezianski-contemi avatar roblankey avatar rtablada avatar sasman0001 avatar shuebner-zeiss avatar sigent avatar wisepotato avatar xaseracheron avatar yohanmishkin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.