This repository was archived by the owner on Jul 10, 2024. It is now read-only.
File tree 4 files changed +6
-13
lines changed
4 files changed +6
-13
lines changed Original file line number Diff line number Diff line change 5
5
<UserSecretsId >aspnet-BackEnd-931E56BD-86CB-4A96-BD99-2C6A6ABB0829</UserSecretsId >
6
6
</PropertyGroup >
7
7
8
- <ItemGroup >
9
- <Compile Remove =" Migrations\20190126203326_Initial.cs" />
10
- <Compile Remove =" Migrations\20190126203326_Initial.Designer.cs" />
11
- <Compile Remove =" Migrations\20190516071446_Initial.cs" />
12
- <Compile Remove =" Migrations\20190516071446_Initial.Designer.cs" />
13
- <Compile Remove =" Migrations\20190516072754_Initial.cs" />
14
- <Compile Remove =" Migrations\20190516072754_Initial.Designer.cs" />
15
- </ItemGroup >
16
-
17
8
<ItemGroup >
18
9
<PackageReference Include =" Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version =" 3.0.0-preview5*" />
19
10
<PackageReference Include =" Microsoft.EntityFrameworkCore.SqlServer" Version =" 3.0.0-preview5*" />
Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ public AttendeesController(ApplicationDbContext db)
20
20
_db = db ;
21
21
}
22
22
23
- [ HttpGet ( "{id }" ) ]
24
- public async Task < ActionResult < AttendeeResponse > > Get ( string id )
23
+ [ HttpGet ( "{username }" ) ]
24
+ public async Task < ActionResult < AttendeeResponse > > Get ( string username )
25
25
{
26
26
var attendee = await _db . Attendees . Include ( a => a . SessionsAttendees )
27
27
. ThenInclude ( sa => sa . Session )
28
- . SingleOrDefaultAsync ( a => a . UserName == id ) ;
28
+ . SingleOrDefaultAsync ( a => a . UserName == username ) ;
29
29
30
30
if ( attendee == null )
31
31
{
@@ -65,7 +65,7 @@ public async Task<ActionResult<AttendeeResponse>> Post(ConferenceDTO.Attendee in
65
65
66
66
var result = attendee . MapAttendeeResponse ( ) ;
67
67
68
- return CreatedAtAction ( nameof ( Get ) , new { id = result . UserName } , result ) ;
68
+ return CreatedAtAction ( nameof ( Get ) , new { username = result . UserName } , result ) ;
69
69
}
70
70
71
71
[ HttpPost ( "{username}/session/{sessionId}" ) ]
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ public static ConferenceDTO.AttendeeResponse MapAttendeeResponse(this Attendee a
51
51
FirstName = attendee . FirstName ,
52
52
LastName = attendee . LastName ,
53
53
UserName = attendee . UserName ,
54
+ EmailAddress = attendee . EmailAddress ,
54
55
Sessions = attendee . SessionsAttendees ?
55
56
. Select ( sa =>
56
57
new ConferenceDTO . Session
Original file line number Diff line number Diff line change 9
9
<PackageReference Include =" Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version =" 3.0.0-preview5*" />
10
10
<PackageReference Include =" Microsoft.AspNetCore.Identity.UI" Version =" 3.0.0-preview5*" />
11
11
<PackageReference Include =" Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version =" 3.0.0-preview5*" />
12
+ <PackageReference Include =" Microsoft.EntityFrameworkCore.Tools" Version =" 3.0.0-preview5*" />
12
13
<PackageReference Include =" Microsoft.EntityFrameworkCore.Sqlite" Version =" 3.0.0-preview5*" />
13
14
<PackageReference Include =" Microsoft.EntityFrameworkCore.SqlServer" Version =" 3.0.0-preview5*" />
14
15
<PackageReference Include =" Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version =" 3.0.0-preview5*" />
You can’t perform that action at this time.
0 commit comments