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

Commit b35e04e

Browse files
davidfowlDamianEdwards
authored andcommitted
Use the extension methods to get search results
1 parent 27cb471 commit b35e04e

File tree

1 file changed

+2
-36
lines changed

1 file changed

+2
-36
lines changed

docs/3. Add front-end, render agenda, set up front-end models.md

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -547,46 +547,12 @@ In this session, we'll add the front end web site, with a public (anonymous) hom
547547
var results = sessionResults.Select(s => new SearchResult
548548
{
549549
Type = SearchResultType.Session,
550-
Session = new SessionResponse
551-
{
552-
Id = s.Id,
553-
Title = s.Title,
554-
Abstract = s.Abstract,
555-
StartTime = s.StartTime,
556-
EndTime = s.EndTime,
557-
TrackId = s.TrackId,
558-
Track = new ConferenceDTO.Track
559-
{
560-
Id = s?.TrackId ?? 0,
561-
Name = s.Track?.Name
562-
},
563-
Speakers = s?.SessionSpeakers
564-
.Select(ss => new ConferenceDTO.Speaker
565-
{
566-
Id = ss.SpeakerId,
567-
Name = ss.Speaker.Name
568-
})
569-
.ToList()
570-
}
550+
Session = s.MapSessionResponse()
571551
})
572552
.Concat(speakerResults.Select(s => new SearchResult
573553
{
574554
Type = SearchResultType.Speaker,
575-
Speaker = new SpeakerResponse
576-
{
577-
Id = s.Id,
578-
Name = s.Name,
579-
Bio = s.Bio,
580-
WebSite = s.WebSite,
581-
Sessions = s.SessionSpeakers?
582-
.Select(ss =>
583-
new ConferenceDTO.Session
584-
{
585-
Id = ss.SessionId,
586-
Title = ss.Session.Title
587-
})
588-
.ToList()
589-
}
555+
Speaker = s.MapSpeakerResponse()
590556
}));
591557

592558
return results.ToList();

0 commit comments

Comments
 (0)