コード例 #1
0
 public async Task <List <DTO.UserInTraining> > FindByAppUserId(Guid appUserId)
 {
     return((await RepoDbSet.AsQueryable()
             .Where(t => t.AppUserId.Equals(appUserId))
             .ToListAsync())
            .Select(domainEntity => Mapper.Map(domainEntity)).ToList());
 }
コード例 #2
0
        public async Task <DTO.NotificationAnswer> findbyNotificationId(Guid id)
        {
            var notAnswer = await RepoDbSet.AsQueryable()
                            .Where(na => na.NotificationId == id).FirstOrDefaultAsync();

            return(NotificationAnswerMapper.Map(notAnswer));
        }
コード例 #3
0
        public async Task <DAL.App.DTO.Notification> FindByTrainingAndUserId(Guid userId, Guid trainingId)
        {
            var notification = RepoDbSet.AsQueryable()
                               .Where(n => n.AppUserId == userId && n.TrainingId == trainingId)
                               .FirstOrDefaultAsync();

            return(NotificationMapper.Map(await notification));
        }
コード例 #4
0
        public async Task <IEnumerable <DAL.App.DTO.Identity.AppUser> > GetAllInUsersInTeam(Guid teamId)
        {
            var users = (await RepoDbSet.AsQueryable().Where(a => a.TeamId.Equals(teamId))
                         .Include("Team")
                         .Include("PlayerPositions")
                         .ToListAsync()).Select(AccountMapper.Map).ToList();

            return(users);
        }
コード例 #5
0
        public override async Task <IEnumerable <GasStation> > GetAllAsync(Guid userId, bool noTracking = true)
        {
            var query = RepoDbSet.AsQueryable();

            var res = query.Include(g => g.Retailer);

            if (noTracking)
            {
                res.AsNoTracking();
            }

            return(await res.ToListAsync());
        }
コード例 #6
0
        public override async Task <FavoriteRetailer> FirstOrDefaultAsync(Guid id, Guid userId, bool noTracking = true)
        {
            var query = RepoDbSet.AsQueryable();

            var res = query.Include(e => e.Retailer);

            if (noTracking)
            {
                res.AsNoTracking();
            }

            return(await res.FirstOrDefaultAsync());
        }
コード例 #7
0
        public override async Task <FuelTypeInGasStation> FirstOrDefaultAsync(Guid id, Guid userId, bool noTracking = true)
        {
            var query = RepoDbSet.AsQueryable();

            var res = query
                      .Include(e => e.FuelType)
                      .Include(e => e.GasStation);

            if (noTracking)
            {
                res.AsNoTracking();
            }

            return(await res.FirstOrDefaultAsync());
        }
コード例 #8
0
 public async Task <IEnumerable <DTO.Notification> > GetAllNotifications(Guid userId)
 {
     return((await RepoDbSet.AsQueryable().Where(n => n.AppUserId.Equals(userId))
             .ToListAsync()).Select(NotificationMapper.Map));
 }
コード例 #9
0
 public async Task <List <DTO.TrainingInBill> > GetTrainingsInBill(Guid billId)
 {
     return((await RepoDbSet.AsQueryable().Where(tib => tib.BillId.Equals(billId)).ToListAsync()).Select(bill =>
                                                                                                         TrainingInBillMapper.MapToDAL(bill)).ToList());
 }
コード例 #10
0
 public async Task <List <DTO.PlayerPosition> > GetUserPositions(Guid userId)
 {
     return
         ((await RepoDbSet.AsQueryable().Where(pos => pos.AppUserId.Equals(userId))
           .ToListAsync()).Select(domainEntity => Mapper.Map(domainEntity)).ToList());
 }
コード例 #11
0
 public async Task <IEnumerable <Bill> > GetUserBills(Guid userId)
 {
     return((await RepoDbSet.AsQueryable().Where(b => b.AppUserId.Equals(userId)).ToListAsync()).Select(domainBill => BillMapper.Map(domainBill)));
 }
コード例 #12
0
 public async Task <List <Comment> > GetAllByTrainingId(Guid trainingId)
 {
     return((await RepoDbSet.AsQueryable().Where(c => c.TrainingId == trainingId).ToListAsync()).Select(c => Mapper.Map(c)).ToList());
 }
コード例 #13
0
 public async Task <List <DTO.UserInTraining> > FindByTrainingId(Guid trainingId)
 {
     return
         ((await RepoDbSet.AsQueryable().Where(t => t.TrainingId.Equals(trainingId)).Include("Training").ToListAsync())
          .Select(UserInTrainingMapper.Map).ToList());
 }
コード例 #14
0
 public async Task <DTO.UserInTraining> FindByAppUserIdAndTrainingId(Guid appUserId, Guid trainingId)
 {
     return(UserInTrainingMapper.Map(await RepoDbSet.AsQueryable()
                                     .Where(t =>
                                            t.AppUserId.Equals(appUserId) && t.TrainingId.Equals(trainingId)).FirstAsync()));
 }