public List <FullProfileViewModel> GetIndexViewModel() { return(_citizenRepository.GetAll() .Select(x => new FullProfileViewModel() { Age = x.Age, Name = x.Name, RegistrationDate = x.CreatingDate }).ToList()); }
private void processCitizens() { var citizens = citizenRepository.GetAll().ToList(); for (int i = 0; i < citizens.Count; ++i) { var citizen = citizens[i]; if (citizen.Worked == false) { citizen.DayWorkedRow = 0; } citizen.Worked = false; if (citizen.HasFood()) { var bread = citizen.GetBestBread(); equipmentRepository.RemoveEquipmentItem(citizen.Entity.EquipmentID.Value, bread.ProductID, bread.Quality); citizen.AddHealth(bread.Quality * 2); } else { citizen.HitPoints -= 10; if (citizen.HitPoints < 0) { citizen.HitPoints = 0; } } citizen.Trained = false; citizen.UsedHospital = false; citizen.DrankTeas = 0; using (NoSaveChanges) walletService.AddMoney(citizen.Entity.WalletID, new structs.Money((int)CurrencyTypeEnum.Gold, 0.5m)); } citizenRepository.SaveChanges(); }
public IEnumerable <CitizenViewModel> GetAll() { return(_mapper.Map <IEnumerable <CitizenViewModel> >(_citizenRepository.GetAll())); }
public async Task <IQueryable <Citizen> > GetCitizenByConditionAsync(Expression <Func <Citizen, bool> > predicate) { return(await Task.FromResult(_citizenRepository.GetAll().Where(predicate))); }
public List <Citizen> GetAll() { List <Citizen> users = _citizenRepo.GetAll(); return(users); }
public IEnumerable <Citizen> GetAll() { return(_citizenRepository.GetAll()); }