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()); }
public async Task <DTO.NotificationAnswer> findbyNotificationId(Guid id) { var notAnswer = await RepoDbSet.AsQueryable() .Where(na => na.NotificationId == id).FirstOrDefaultAsync(); return(NotificationAnswerMapper.Map(notAnswer)); }
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)); }
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); }
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()); }
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()); }
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()); }
public async Task <IEnumerable <DTO.Notification> > GetAllNotifications(Guid userId) { return((await RepoDbSet.AsQueryable().Where(n => n.AppUserId.Equals(userId)) .ToListAsync()).Select(NotificationMapper.Map)); }
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()); }
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()); }
public async Task <IEnumerable <Bill> > GetUserBills(Guid userId) { return((await RepoDbSet.AsQueryable().Where(b => b.AppUserId.Equals(userId)).ToListAsync()).Select(domainBill => BillMapper.Map(domainBill))); }
public async Task <List <Comment> > GetAllByTrainingId(Guid trainingId) { return((await RepoDbSet.AsQueryable().Where(c => c.TrainingId == trainingId).ToListAsync()).Select(c => Mapper.Map(c)).ToList()); }
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()); }
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())); }