public async Task <EditionActivityDTO> GetByIdAndLanguage(string id, string language) { var result = await this.dbContext .Set <EditionActivity>() .Where(c => c.Id == id) .Include(c => c.Details) .Include(c => c.Users) .ThenInclude(presenter => presenter.User) .ThenInclude(presenter => presenter.Details) .Include(c => c.Users) .ThenInclude(presenter => presenter.User) .ThenInclude(user => user.SocialLinks) .Select(item => EditionActivityUtils.ToEditionActivityDTO(item, language)) .FirstOrDefaultAsync(); return(result); }
public async Task <IReadOnlyCollection <EditionActivityDTO> > GetAllEditionActivitiesByEditionAndLanguage(string editionId, string language) { var result = await this.dbContext .Set <EditionActivity>() .Where(c => c.Edition.Id == editionId) .Include(c => c.Details) .Include(c => c.Users) .ThenInclude(presenter => presenter.User) .ThenInclude(presenter => presenter.Details) .Include(c => c.Users) .ThenInclude(presenter => presenter.User) .ThenInclude(user => user.SocialLinks) .Select(item => EditionActivityUtils.ToEditionActivityDTO(item, language)) .ToListAsync(); return(new ReadOnlyCollection <EditionActivityDTO>(result)); }