File tree 2 files changed +4
-20
lines changed
test/JsonApiDotNetCoreExampleTests 2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ public async Task Injecting_IRequestMeta_Adds_Meta_Data()
40
40
41
41
// act
42
42
var response = await client . SendAsync ( request ) ;
43
- var documents = JsonConvert . DeserializeObject < Documents > ( await response . Content . ReadAsStringAsync ( ) ) ;
43
+ var body = await response . Content . ReadAsStringAsync ( ) ;
44
+ var documents = JsonConvert . DeserializeObject < Documents > ( body ) ;
44
45
45
46
// assert
46
47
Assert . Equal ( HttpStatusCode . OK , response . StatusCode ) ;
Original file line number Diff line number Diff line change 1
1
using Microsoft . AspNetCore . Hosting ;
2
2
using Microsoft . Extensions . DependencyInjection ;
3
- using Microsoft . Extensions . Logging ;
4
- using JsonApiDotNetCoreExample . Data ;
5
- using Microsoft . EntityFrameworkCore ;
6
- using JsonApiDotNetCore . Extensions ;
7
3
using System ;
8
4
using JsonApiDotNetCoreExample ;
9
5
using JsonApiDotNetCore . Services ;
@@ -19,21 +15,8 @@ public MetaStartup(IHostingEnvironment env)
19
15
20
16
public override IServiceProvider ConfigureServices ( IServiceCollection services )
21
17
{
22
- var loggerFactory = new LoggerFactory ( ) ;
23
- loggerFactory . AddConsole ( LogLevel . Warning ) ;
24
-
25
- services
26
- . AddSingleton < ILoggerFactory > ( loggerFactory )
27
- . AddDbContext < AppDbContext > ( options =>
28
- options . UseNpgsql ( GetDbConnectionString ( ) ) , ServiceLifetime . Transient )
29
- . AddJsonApi < AppDbContext > ( options => {
30
- options . Namespace = "api/v1" ;
31
- options . DefaultPageSize = 5 ;
32
- options . IncludeTotalRecordCount = true ;
33
- } )
34
- . AddScoped < IRequestMeta , MetaService > ( ) ;
35
-
36
- return services . BuildServiceProvider ( ) ;
18
+ services . AddScoped < IRequestMeta , MetaService > ( ) ;
19
+ return base . ConfigureServices ( services ) ;
37
20
}
38
21
}
39
22
}
You can’t perform that action at this time.
0 commit comments