public async Task <List <DAL.App.DTO.Show> > AllForUserAsync(int userId)
        {
            var culture = Thread.CurrentThread.CurrentUICulture.Name.Substring(0, 2).ToLower();

            var res = await RepositoryDbSet
                      .Select(c => new
            {
                Id            = c.Id,
                Title         = c.Title,
                Start         = c.Start,
                End           = c.End,
                Translations  = c.Title.Translations,
                Comment       = c.Comment,
                Translations2 = c.Comment.Translations,
            })
                      .ToListAsync();

            var resultList = res.Select(c => new  DTO.Show()
            {
                Id      = c.Id,
                Title   = c.Title.Translate(),
                Comment = c.Comment.Translate(),
                Start   = c.Start,
                End     = c.End,
            }).ToList();

            return(resultList);
        }
 public virtual async Task <List <ParticipantNames> > GetAllParticipantAsync()
 {
     return(await RepositoryDbSet
            .Select(p => new ParticipantNames()
     {
         Id = p.Id,
         FirstName = p.FirstName,
         LastName = p.LastName
     }).ToListAsync());
 }
Exemple #3
0
 public async Task <IEnumerable <RelationshipDTO> > AllAsyncApi()
 {
     return(await RepositoryDbSet
            .Select(e => new RelationshipDTO()
     {
         Id = e.Id,
         Relation = e.Relation.ToString()
     })
            .ToListAsync());
 }
Exemple #4
0
 public async Task <List <DAL.App.DTO.Location> > AllForUserAsync(int userId)
 {
     return(await RepositoryDbSet
            .Select(e => LocationMapper.MapFromDomain(e)).ToListAsync());
 }
Exemple #5
0
 public async Task <List <Event> > AllPastAsync()
 {
     return(await RepositoryDbSet
            .Select(e => EventMapper.MapFromDomain(e)).ToListAsync());
 }
 public async Task <List <DAL.App.DTO.AdministrativeUnit> > AllForUserAsync(int userId)
 {
     return(await RepositoryDbSet
            .Select(e => AdministrativeUnitMapper.MapFromDomain(e)).ToListAsync());
 }