You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ services.AddJsonApi(config => {
76
76
});
77
77
```
78
78
79
-
The controller **must** implement `IJsonApiController`, and it **may** inherit from `JsonApiController`.
79
+
The controller **must** implement `IJsonApiController`, and it **may** inherit from [JsonApiController](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/JsonApiDotNetCore/Controllers/JsonApiController.cs).
80
80
Constructor dependency injection will work like normal.
81
81
Any services added in your `Startup.ConfigureServices()` method will be injected into the constructor parameters.
82
82
@@ -85,7 +85,7 @@ public class TodoItemsController : JsonApiController, IJsonApiController
85
85
{
86
86
private ApplicationDbContext _dbContext;
87
87
88
-
public TodoItemsController(JsonApiContext jsonApiContext, ResourceRepository resourceRepository, ApplicationDbContext applicationDbContext)
88
+
public TodoItemsController(IJsonApiContext jsonApiContext, ResourceRepository resourceRepository, ApplicationDbContext applicationDbContext)
89
89
: base(jsonApiContext, resourceRepository)
90
90
{
91
91
_dbContext = applicationDbContext;
@@ -98,6 +98,8 @@ public class TodoItemsController : JsonApiController, IJsonApiController
98
98
}
99
99
```
100
100
101
+
You can access the HttpContext from [IJsonApiContext](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/JsonApiDotNetCore/Abstractions/IJsonApiContext.cs).
0 commit comments