File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using JsonApiDotNetCore . Configuration ;
3
+ using JsonApiDotNetCore . Routing ;
4
+ using Microsoft . AspNetCore . Http ;
5
+
6
+ namespace JsonApiDotNetCore . Abstractions
7
+ {
8
+ public interface IJsonApiContext
9
+ {
10
+ JsonApiModelConfiguration Configuration { get ; }
11
+ object DbContext { get ; }
12
+ HttpContext HttpContext { get ; }
13
+ Route Route { get ; }
14
+ string GetEntityName ( ) ;
15
+ Type GetEntityType ( ) ;
16
+ Type GetJsonApiResourceType ( ) ;
17
+ }
18
+ }
Original file line number Diff line number Diff line change 7
7
8
8
namespace JsonApiDotNetCore . Abstractions
9
9
{
10
- public class JsonApiContext
10
+ public class JsonApiContext : IJsonApiContext
11
11
{
12
12
public HttpContext HttpContext { get ; }
13
13
public Route Route { get ; }
Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ namespace JsonApiDotNetCore.Controllers
8
8
{
9
9
public class JsonApiController : IJsonApiController
10
10
{
11
- protected readonly JsonApiContext JsonApiContext ;
11
+ protected readonly IJsonApiContext JsonApiContext ;
12
12
private readonly ResourceRepository _resourceRepository ;
13
13
14
- public JsonApiController ( JsonApiContext jsonApiContext , ResourceRepository resourceRepository )
14
+ public JsonApiController ( IJsonApiContext jsonApiContext , ResourceRepository resourceRepository )
15
15
{
16
16
JsonApiContext = jsonApiContext ;
17
17
_resourceRepository = resourceRepository ;
You can’t perform that action at this time.
0 commit comments