This repository was archived by the owner on Jul 10, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 13 files changed +42
-49
lines changed Expand file tree Collapse file tree 13 files changed +42
-49
lines changed Original file line number Diff line number Diff line change 1
1
<Project >
2
2
<PropertyGroup >
3
3
<!-- .NET Core daily build feeds -->
4
- <RestoreSources >
4
+ <!-- < RestoreSources>
5
5
$(RestoreSources);
6
6
https://api.nuget.org/v3/index.json;
7
7
https://dotnetfeed.blob.core.windows.net/dotnet-core-preview7-012802/index.json;
8
8
https://grpc.jfrog.io/grpc/api/nuget/v3/grpc-nuget-dev;
9
- </RestoreSources >
10
- <DisableImplicitAspNetCoreAnalyzers >true </DisableImplicitAspNetCoreAnalyzers >
9
+ </RestoreSources>-->
10
+ <DisableImplicitAspNetCoreAnalyzers >false </DisableImplicitAspNetCoreAnalyzers >
11
11
</PropertyGroup >
12
12
</Project >
Original file line number Diff line number Diff line change 3
3
<PropertyGroup >
4
4
<TargetFramework >netcoreapp3.0</TargetFramework >
5
5
<UserSecretsId >aspnet-BackEnd-931E56BD-86CB-4A96-BD99-2C6A6ABB0829</UserSecretsId >
6
+ <IncludeOpenAPIAnalyzers >true</IncludeOpenAPIAnalyzers >
6
7
</PropertyGroup >
7
8
8
9
<ItemGroup >
9
- <PackageReference Include =" Microsoft.EntityFrameworkCore.SqlServer" Version =" 3.0.0-preview7.19352.17 " />
10
- <PackageReference Include =" Microsoft.EntityFrameworkCore.Sqlite" Version =" 3.0.0-preview7.19352.17 " />
11
- <PackageReference Include =" Microsoft.EntityFrameworkCore.Tools" Version =" 3.0.0-preview7.19352.17 " >
10
+ <PackageReference Include =" Microsoft.EntityFrameworkCore.SqlServer" Version =" 3.0.0-preview* " />
11
+ <PackageReference Include =" Microsoft.EntityFrameworkCore.Sqlite" Version =" 3.0.0-preview* " />
12
+ <PackageReference Include =" Microsoft.EntityFrameworkCore.Tools" Version =" 3.0.0-preview* " >
12
13
<PrivateAssets >all</PrivateAssets >
13
14
<IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
14
15
</PackageReference >
15
- <PackageReference Include =" Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version =" 3.0.0-preview7.19353.9" />
16
- <PackageReference Include =" Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version =" 3.0.0-preview7.19353.9" />
17
- <PackageReference Include =" Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version =" 3.0.0-preview7.19353.9" />
16
+ <PackageReference Include =" Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version =" 3.0.0-preview*" />
17
+ <PackageReference Include =" Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version =" 3.0.0-preview*" />
18
18
<PackageReference Include =" Swashbuckle.AspNetCore" Version =" 5.0.0-rc2" />
19
- <PackageReference Include =" Microsoft.VisualStudio.Web.CodeGeneration.Design" Version =" 3.0.0-preview6-19319-03 " >
19
+ <PackageReference Include =" Microsoft.VisualStudio.Web.CodeGeneration.Design" Version =" 3.0.0-preview* " >
20
20
<PrivateAssets >all</PrivateAssets >
21
21
</PackageReference >
22
22
</ItemGroup >
Original file line number Diff line number Diff line change 1
1
using System . Collections . Generic ;
2
2
using System . Linq ;
3
3
using System . Threading . Tasks ;
4
- using BackEnd . Data ;
5
4
using Microsoft . AspNetCore . Mvc ;
6
5
using Microsoft . EntityFrameworkCore ;
7
6
using Microsoft . AspNetCore . Http ;
7
+ using BackEnd . Data ;
8
8
using ConferenceDTO ;
9
9
10
10
namespace BackEnd . Controllers
@@ -21,6 +21,9 @@ public AttendeesController(ApplicationDbContext db)
21
21
}
22
22
23
23
[ HttpGet ( "{username}" ) ]
24
+ [ ProducesResponseType ( StatusCodes . Status200OK ) ]
25
+ [ ProducesResponseType ( StatusCodes . Status404NotFound ) ]
26
+ [ ProducesDefaultResponseType ]
24
27
public async Task < ActionResult < AttendeeResponse > > Get ( string username )
25
28
{
26
29
var attendee = await _db . Attendees . Include ( a => a . SessionsAttendees )
@@ -45,11 +48,10 @@ public async Task<ActionResult<List<SessionResponse>>> GetSessions(string userna
45
48
. Include ( s => s . SessionSpeakers )
46
49
. ThenInclude ( ss => ss . Speaker )
47
50
. Where ( s => s . SessionAttendees . Any ( sa => sa . Attendee . UserName == username ) )
48
- // .Select(m => m.MapSessionResponse())
51
+ . Select ( m => m . MapSessionResponse ( ) )
49
52
. ToListAsync ( ) ;
50
53
51
- // BUG: Working around EF Core 3.0 issue: https://github.com/aspnet/EntityFrameworkCore/issues/16318
52
- return sessions . Select ( s => s . MapSessionResponse ( ) ) . ToList ( ) ;
54
+ return sessions ;
53
55
}
54
56
55
57
[ HttpPost ]
Original file line number Diff line number Diff line change 1
1
using System . Collections . Generic ;
2
2
using System . Linq ;
3
3
using System . Threading . Tasks ;
4
- using BackEnd . Data ;
5
- using ConferenceDTO ;
6
4
using Microsoft . AspNetCore . Mvc ;
7
5
using Microsoft . EntityFrameworkCore ;
6
+ using BackEnd . Data ;
7
+ using ConferenceDTO ;
8
8
9
9
namespace BackEnd . Controllers
10
10
{
Original file line number Diff line number Diff line change 2
2
using System . ComponentModel . DataAnnotations ;
3
3
using System . Linq ;
4
4
using System . Threading . Tasks ;
5
- using BackEnd . Data ;
6
- using ConferenceDTO ;
7
5
using Microsoft . AspNetCore . Http ;
8
6
using Microsoft . AspNetCore . Mvc ;
9
7
using Microsoft . EntityFrameworkCore ;
8
+ using BackEnd . Data ;
9
+ using ConferenceDTO ;
10
10
11
11
namespace BackEnd . Controllers
12
12
{
@@ -28,12 +28,10 @@ public async Task<ActionResult<List<SessionResponse>>> Get()
28
28
. Include ( s => s . Track )
29
29
. Include ( s => s . SessionSpeakers )
30
30
. ThenInclude ( ss => ss . Speaker )
31
- // .Select(m => m.MapSessionResponse())
31
+ . Select ( m => m . MapSessionResponse ( ) )
32
32
. ToListAsync ( ) ;
33
33
34
- // BUG: Working around EF Core 3.0 issue: https://github.com/aspnet/EntityFrameworkCore/issues/16318
35
- return sessions . Select ( s => s . MapSessionResponse ( ) )
36
- . ToList ( ) ;
34
+ return sessions ;
37
35
}
38
36
39
37
[ HttpGet ( "{id}" ) ]
Original file line number Diff line number Diff line change @@ -25,11 +25,10 @@ public async Task<ActionResult<List<SpeakerResponse>>> GetSpeakers()
25
25
var speakers = await _db . Speakers . AsNoTracking ( )
26
26
. Include ( s => s . SessionSpeakers )
27
27
. ThenInclude ( ss => ss . Session )
28
- // .Select(s => s.MapSpeakerResponse())
28
+ . Select ( s => s . MapSpeakerResponse ( ) )
29
29
. ToListAsync ( ) ;
30
30
31
- // BUG: Working around EF Core 3.0 issue: https://github.com/aspnet/EntityFrameworkCore/issues/16318
32
- return speakers . Select ( s => s . MapSpeakerResponse ( ) ) . ToList ( ) ;
31
+ return speakers ;
33
32
}
34
33
35
34
[ HttpGet ( "{id}" ) ]
Original file line number Diff line number Diff line change 10
10
using Microsoft . Extensions . Configuration ;
11
11
using Microsoft . Extensions . DependencyInjection ;
12
12
using Microsoft . Extensions . Hosting ;
13
- using BackEnd . Data ;
14
13
using Microsoft . OpenApi . Models ;
14
+ using BackEnd . Data ;
15
15
16
16
[ assembly: ApiConventionType ( typeof ( DefaultApiConventions ) ) ]
17
17
@@ -41,10 +41,7 @@ public void ConfigureServices(IServiceCollection services)
41
41
} ) ;
42
42
43
43
services . AddControllers ( )
44
- . SetCompatibilityVersion ( CompatibilityVersion . Version_3_0 )
45
- // BUG: There's an issue with the default JSON formatters right now that is causing truncation of results.
46
- // Uncomment following line to make app functional.
47
- . AddNewtonsoftJson ( ) ;
44
+ . SetCompatibilityVersion ( CompatibilityVersion . Version_3_0 ) ;
48
45
49
46
services . AddHealthChecks ( )
50
47
. AddDbContextCheck < ApplicationDbContext > ( ) ;
Original file line number Diff line number Diff line change 6
6
</PropertyGroup >
7
7
8
8
<ItemGroup >
9
- <PackageReference Include =" Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version =" 3.0.0-preview7.19353.9 " />
10
- <PackageReference Include =" Microsoft.AspNetCore.Identity.UI" Version =" 3.0.0-preview7.19353.9 " />
11
- <PackageReference Include =" Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version =" 3.0.0-preview7.19353.9 " />
12
- <PackageReference Include =" Microsoft.EntityFrameworkCore.Tools" Version =" 3.0.0-preview7.19352.17 " >
9
+ <PackageReference Include =" Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version =" 3.0.0-preview* " />
10
+ <PackageReference Include =" Microsoft.AspNetCore.Identity.UI" Version =" 3.0.0-preview* " />
11
+ <PackageReference Include =" Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version =" 3.0.0-preview* " />
12
+ <PackageReference Include =" Microsoft.EntityFrameworkCore.Tools" Version =" 3.0.0-preview* " >
13
13
<PrivateAssets >all</PrivateAssets >
14
14
<IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
15
15
</PackageReference >
16
- <PackageReference Include =" Microsoft.EntityFrameworkCore.Sqlite" Version =" 3.0.0-preview7.19352.17 " />
17
- <PackageReference Include =" Microsoft.EntityFrameworkCore.SqlServer" Version =" 3.0.0-preview7.19352.17 " />
18
- <PackageReference Include =" Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version =" 3.0.0-preview7.19353.9 " />
16
+ <PackageReference Include =" Microsoft.EntityFrameworkCore.Sqlite" Version =" 3.0.0-preview* " />
17
+ <PackageReference Include =" Microsoft.EntityFrameworkCore.SqlServer" Version =" 3.0.0-preview* " />
18
+ <PackageReference Include =" Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version =" 3.0.0-preview* " />
19
19
<PackageReference Include =" Microsoft.AspNet.WebApi.Client" Version =" 5.2.7" />
20
- <PackageReference Include =" Microsoft.VisualStudio.Web.CodeGeneration.Design" Version =" 3.0.0-preview6-19319-03 " >
20
+ <PackageReference Include =" Microsoft.VisualStudio.Web.CodeGeneration.Design" Version =" 3.0.0-preview* " >
21
21
<PrivateAssets >all</PrivateAssets >
22
22
</PackageReference >
23
23
</ItemGroup >
Original file line number Diff line number Diff line change 1
1
using System . Threading . Tasks ;
2
- using FrontEnd . Services ;
3
- using FrontEnd . Pages . Models ;
4
2
using Microsoft . AspNetCore . Mvc ;
5
3
using Microsoft . AspNetCore . Mvc . RazorPages ;
6
- using Microsoft . AspNetCore . Authorization ;
7
- using Microsoft . AspNetCore . Mvc . Filters ;
8
4
using Microsoft . Extensions . Caching . Memory ;
9
5
using FrontEnd . Infrastructure ;
6
+ using FrontEnd . Pages . Models ;
7
+ using FrontEnd . Services ;
10
8
11
9
namespace FrontEnd . Pages
12
10
{
Original file line number Diff line number Diff line change
1
+ @attribute [Authorize("Admin")]
You can’t perform that action at this time.
0 commit comments