1 Star 0 Fork 0

anysharp/JsonApiDotNetCore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

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:

About

Official documentation

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

#nullable enable

[Resource]
public class Article : Identifiable<int>
{
    [Attr]
    public string Name { get; set; } = null!;
}

Middleware

// Program.cs

builder.Services.AddJsonApi<AppDbContext>();

// ...

app.UseRouting();
app.UseJsonApi();
app.MapControllers();

Compatibility

The following chart should help you pick the best version, based on your environment. See also our versioning policy.

JsonApiDotNetCore Status .NET Entity Framework Core
3.x Stable Core 2.x 2.x
4.x Stable Core 3.1 3.1, 5
5 5
6 5
5.0.0-5.0.2 Stable 6 6
5.0.3-5.4.0 Stable 6 6, 7
7 7
5.5+ Stable 6 6, 7
7 7
8 8
master Preview 6 6, 7
7 7
8 8
openapi Experimental 6 6, 7
7 7
8 8

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 pre-release NuGet package is automatically published to GitHub Packages. To try it out, follow the steps below:

  1. Create a Personal Access Token (classic) with at least read:packages scope.

  2. Add our package source to your local user-specific nuget.config file by running:

    dotnet nuget add source https://nuget.pkg.github.com/json-api-dotnet/index.json --name github-json-api --username YOUR-GITHUB-USERNAME --password YOUR-PAT-CLASSIC
    

    In the command above:

    • Replace YOUR-GITHUB-USERNAME with the username you use to login your GitHub account.
    • Replace YOUR-PAT-CLASSIC with the token your created above.

    If the above command doesn't give you access in the next step, remove the package source by running:

    dotnet nuget remove source github-json-api
    

    and retry with the --store-password-in-clear-text switch added.

  3. Restart your IDE, open your project, and browse the list of packages from the github-json-api feed (make sure pre-release packages are included).

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:

pwsh run-docker-postgres.ps1

And then to run the tests:

dotnet test

Alternatively, to build, run all tests, generate code coverage and NuGet packages:

pwsh Build.ps1

Sponsors

JetBrains Logo   Araxis Logo

Copyright (c) 2017 Jared Nance MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

用于使用 ASP.NET 和 Entity Framework Core 构建符合 JSON:API 的 REST API 的框架。 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/anysharp/JsonApiDotNetCore.git
git@gitee.com:anysharp/JsonApiDotNetCore.git
anysharp
JsonApiDotNetCore
JsonApiDotNetCore
master

搜索帮助