Skip to content

Commit d393cb5

Browse files
committed
fix(#167): readme
1 parent 7e2dd0e commit d393cb5

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

README.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
![alt text](https://raw.githubusercontent.com/json-api-dotnet/JsonApiDotnetCore/master/logo.png)
1+
<div style="text-align:center">
2+
<img src ="https://raw.githubusercontent.com/json-api-dotnet/JsonApiDotnetCore/master/logo.png" />
3+
</div>
24

35
# JSON API .Net Core
46

57
[![Build status](https://ci.appveyor.com/api/projects/status/9fvgeoxdikwkom10?svg=true)](https://ci.appveyor.com/project/jaredcnance/json-api-dotnet-core)
6-
[![Travis](https://img.shields.io/travis/Research-Institute/json-api-dotnet-core.svg?maxAge=3600&label=travis)](https://travis-ci.org/Research-Institute/json-api-dotnet-core)
8+
[![Travis](https://travis-ci.org/json-api-dotnet/JsonApiDotNetCore.svg?branch=master)](https://travis-ci.org/json-api-dotnet/JsonApiDotNetCore)
79
[![NuGet](https://img.shields.io/nuget/v/JsonApiDotNetCore.svg)](https://www.nuget.org/packages/JsonApiDotNetCore/)
810
[![MyGet CI](https://img.shields.io/myget/research-institute/vpre/JsonApiDotNetCore.svg)](https://www.myget.org/feed/research-institute/package/nuget/JsonApiDotNetCore)
911
[![Join the chat at https://gitter.im/json-api-dotnet-core/Lobby](https://badges.gitter.im/json-api-dotnet-core/Lobby.svg)](https://gitter.im/json-api-dotnet-core/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
@@ -13,8 +15,46 @@ A framework for building [json:api](http://jsonapi.org/) compliant web APIs. The
1315

1416
## Installation And Usage
1517

16-
See the documentation [here](https://research-institute.github.io/json-api-dotnet-core)
18+
See [the documentation](https://json-api-dotnet.github.io/JsonApiDotNetCore/) for detailed usage.
1719

20+
### Models
21+
22+
```csharp
23+
public class Article : Identifiable
24+
{
25+
[Attr("name")]
26+
public string Name { get; set; }
27+
}
28+
```
29+
30+
### Controllers
31+
32+
```csharp
33+
public class ArticlesController : JsonApiController<Article>
34+
{
35+
public ArticlesController(
36+
IJsonApiContext jsonApiContext,
37+
IResourceService<Article> resourceService)
38+
: base(jsonApiContext, resourceService) { }
39+
}
40+
```
41+
42+
### Middleware
43+
44+
```csharp
45+
public class Startup
46+
{
47+
public IServiceProvider ConfigureServices(IServiceCollection services) {
48+
services.AddJsonApi<AppDbContext>();
49+
// ...
50+
}
51+
52+
public void Configure(IApplicationBuilder app) {
53+
app.UseJsonApi()
54+
// ...
55+
}
56+
}
57+
```
1858

1959
## .Net Core v2 Notes
2060

couscous.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ branch: gh-pages
3434

3535
# Base URL of the published website (no "/" at the end!)
3636
# You are advised to set and use this variable to write your links in the HTML layouts
37-
baseUrl: https://research-institute.github.io/json-api-dotnet-core
37+
baseUrl: https://json-api-dotnet.github.io/JsonApiDotNetCore/
3838
github:
3939
user: research-institute
4040
repo: json-api-dotnet-core

0 commit comments

Comments
 (0)