Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit 19c485e

Browse files
committed
Updated for preview9
1 parent 20b730c commit 19c485e

13 files changed

+42
-49
lines changed

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project>
22
<PropertyGroup>
33
<!-- .NET Core daily build feeds -->
4-
<RestoreSources>
4+
<!--<RestoreSources>
55
$(RestoreSources);
66
https://api.nuget.org/v3/index.json;
77
https://dotnetfeed.blob.core.windows.net/dotnet-core-preview7-012802/index.json;
88
https://grpc.jfrog.io/grpc/api/nuget/v3/grpc-nuget-dev;
9-
</RestoreSources>
10-
<DisableImplicitAspNetCoreAnalyzers>true</DisableImplicitAspNetCoreAnalyzers>
9+
</RestoreSources>-->
10+
<DisableImplicitAspNetCoreAnalyzers>false</DisableImplicitAspNetCoreAnalyzers>
1111
</PropertyGroup>
1212
</Project>

src/BackEnd/BackEnd.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.0</TargetFramework>
55
<UserSecretsId>aspnet-BackEnd-931E56BD-86CB-4A96-BD99-2C6A6ABB0829</UserSecretsId>
6+
<IncludeOpenAPIAnalyzers>true</IncludeOpenAPIAnalyzers>
67
</PropertyGroup>
78

89
<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*">
1213
<PrivateAssets>all</PrivateAssets>
1314
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1415
</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*" />
1818
<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*">
2020
<PrivateAssets>all</PrivateAssets>
2121
</PackageReference>
2222
</ItemGroup>

src/BackEnd/Controllers/AttendeesController.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System.Collections.Generic;
22
using System.Linq;
33
using System.Threading.Tasks;
4-
using BackEnd.Data;
54
using Microsoft.AspNetCore.Mvc;
65
using Microsoft.EntityFrameworkCore;
76
using Microsoft.AspNetCore.Http;
7+
using BackEnd.Data;
88
using ConferenceDTO;
99

1010
namespace BackEnd.Controllers
@@ -21,6 +21,9 @@ public AttendeesController(ApplicationDbContext db)
2121
}
2222

2323
[HttpGet("{username}")]
24+
[ProducesResponseType(StatusCodes.Status200OK)]
25+
[ProducesResponseType(StatusCodes.Status404NotFound)]
26+
[ProducesDefaultResponseType]
2427
public async Task<ActionResult<AttendeeResponse>> Get(string username)
2528
{
2629
var attendee = await _db.Attendees.Include(a => a.SessionsAttendees)
@@ -45,11 +48,10 @@ public async Task<ActionResult<List<SessionResponse>>> GetSessions(string userna
4548
.Include(s => s.SessionSpeakers)
4649
.ThenInclude(ss => ss.Speaker)
4750
.Where(s => s.SessionAttendees.Any(sa => sa.Attendee.UserName == username))
48-
//.Select(m => m.MapSessionResponse())
51+
.Select(m => m.MapSessionResponse())
4952
.ToListAsync();
5053

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;
5355
}
5456

5557
[HttpPost]

src/BackEnd/Controllers/SearchController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System.Collections.Generic;
22
using System.Linq;
33
using System.Threading.Tasks;
4-
using BackEnd.Data;
5-
using ConferenceDTO;
64
using Microsoft.AspNetCore.Mvc;
75
using Microsoft.EntityFrameworkCore;
6+
using BackEnd.Data;
7+
using ConferenceDTO;
88

99
namespace BackEnd.Controllers
1010
{

src/BackEnd/Controllers/SessionsController.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
using System.ComponentModel.DataAnnotations;
33
using System.Linq;
44
using System.Threading.Tasks;
5-
using BackEnd.Data;
6-
using ConferenceDTO;
75
using Microsoft.AspNetCore.Http;
86
using Microsoft.AspNetCore.Mvc;
97
using Microsoft.EntityFrameworkCore;
8+
using BackEnd.Data;
9+
using ConferenceDTO;
1010

1111
namespace BackEnd.Controllers
1212
{
@@ -28,12 +28,10 @@ public async Task<ActionResult<List<SessionResponse>>> Get()
2828
.Include(s => s.Track)
2929
.Include(s => s.SessionSpeakers)
3030
.ThenInclude(ss => ss.Speaker)
31-
//.Select(m => m.MapSessionResponse())
31+
.Select(m => m.MapSessionResponse())
3232
.ToListAsync();
3333

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;
3735
}
3836

3937
[HttpGet("{id}")]

src/BackEnd/Controllers/SpeakersController.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ public async Task<ActionResult<List<SpeakerResponse>>> GetSpeakers()
2525
var speakers = await _db.Speakers.AsNoTracking()
2626
.Include(s => s.SessionSpeakers)
2727
.ThenInclude(ss => ss.Session)
28-
//.Select(s => s.MapSpeakerResponse())
28+
.Select(s => s.MapSpeakerResponse())
2929
.ToListAsync();
3030

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;
3332
}
3433

3534
[HttpGet("{id}")]

src/BackEnd/Startup.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
using Microsoft.Extensions.Configuration;
1111
using Microsoft.Extensions.DependencyInjection;
1212
using Microsoft.Extensions.Hosting;
13-
using BackEnd.Data;
1413
using Microsoft.OpenApi.Models;
14+
using BackEnd.Data;
1515

1616
[assembly: ApiConventionType(typeof(DefaultApiConventions))]
1717

@@ -41,10 +41,7 @@ public void ConfigureServices(IServiceCollection services)
4141
});
4242

4343
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);
4845

4946
services.AddHealthChecks()
5047
.AddDbContextCheck<ApplicationDbContext>();

src/FrontEnd/FrontEnd.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
</PropertyGroup>
77

88
<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*">
1313
<PrivateAssets>all</PrivateAssets>
1414
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1515
</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*" />
1919
<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*">
2121
<PrivateAssets>all</PrivateAssets>
2222
</PackageReference>
2323
</ItemGroup>

src/FrontEnd/Pages/Admin/EditSession.cshtml.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
using System.Threading.Tasks;
2-
using FrontEnd.Services;
3-
using FrontEnd.Pages.Models;
42
using Microsoft.AspNetCore.Mvc;
53
using Microsoft.AspNetCore.Mvc.RazorPages;
6-
using Microsoft.AspNetCore.Authorization;
7-
using Microsoft.AspNetCore.Mvc.Filters;
84
using Microsoft.Extensions.Caching.Memory;
95
using FrontEnd.Infrastructure;
6+
using FrontEnd.Pages.Models;
7+
using FrontEnd.Services;
108

119
namespace FrontEnd.Pages
1210
{
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@attribute [Authorize("Admin")]

0 commit comments

Comments
 (0)