Giter Site home page Giter Site logo

vishaltsalwe / jsonapidotnetcore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from json-api-dotnet/jsonapidotnetcore

0.0 2.0 0.0 2.27 MB

JSONAPI Framework for ASP.Net Core

Home Page: https://json-api-dotnet.github.io/#/

License: MIT License

PowerShell 0.28% C# 99.62% Shell 0.08% Dockerfile 0.02%

jsonapidotnetcore's Introduction

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()
        // ...
    }
}

Development

Restore all nuget packages with:

dotnet restore

Testing

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

docker run --rm --name jsonapi-dotnet-core-testing \
  -e POSTGRES_DB=JsonApiDotNetCoreExample \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -p 5432:5432 \
  postgres

And then to run the tests:

dotnet test

Cleaning

Sometimes the compiled files can be dirty / corrupt from other branches / failed builds.

dotnet clean

jsonapidotnetcore's People

Contributors

jaredcnance avatar roblankey avatar nullvoxpopuli avatar milosloub avatar btecu avatar rtablada avatar sigent avatar shuebner-zeiss avatar crfloyd avatar janmattner avatar maurei avatar jfhs avatar yohanmishkin avatar xaseracheron avatar nwise avatar lheiskan avatar joshhubers avatar jasolko avatar biarity avatar dnperfors avatar jonnolen avatar medokin avatar gitter-badger avatar

Watchers

Vishal Salwe avatar James Cloos 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.