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

Commit 73a7035

Browse files
committed
Got app working
1 parent 297730d commit 73a7035

12 files changed

+126
-712
lines changed

src/BackEnd/Controllers/AttendeesController.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ public async Task<ActionResult<AttendeeResponse>> Get(string username)
3737
return result;
3838
}
3939

40+
[HttpGet("{username}/sessions")]
41+
public async Task<ActionResult<List<SessionResponse>>> GetSessions(string username)
42+
{
43+
var sessions = await _db.Sessions.AsNoTracking()
44+
.Include(s => s.Track)
45+
.Include(s => s.SessionSpeakers)
46+
.ThenInclude(ss => ss.Speaker)
47+
.Where(s => s.SessionAttendees.Any(sa => sa.Attendee.UserName == username))
48+
.Select(m => m.MapSessionResponse())
49+
.ToListAsync();
50+
return sessions;
51+
}
52+
4053
[HttpPost]
4154
[ProducesResponseType(StatusCodes.Status201Created)]
4255
[ProducesResponseType(StatusCodes.Status409Conflict)]

src/BackEnd/Data/Session.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ public class Session : ConferenceDTO.Session
88
{
99
public virtual ICollection<SessionSpeaker> SessionSpeakers { get; set; }
1010

11+
public virtual ICollection<SessionAttendee> SessionAttendees { get; set; }
12+
1113
public Track Track { get; set; }
1214
}
1315
}

src/BackEnd/Migrations/20190516073157_Initial.Designer.cs

Lines changed: 0 additions & 180 deletions
This file was deleted.

src/BackEnd/Migrations/20190516073157_Initial.cs

Lines changed: 0 additions & 169 deletions
This file was deleted.

0 commit comments

Comments
 (0)