private static void ValidateFlatToCount(int count) { Debug.Assert(roomService.GetAll().Count() == count); Debug.Assert(flatService.GetAll().Count() == count); Debug.Assert(residenceService.GetAll().Count() == count); Debug.Assert(houseService.GetAll().Count() == count); var plots = plotService.GetAll(); Debug.Assert(plots.Count() == count); }
private List <SelectListItem> GetHouseList() { var houses = _houseService.GetAll(null); var housesList = houses.Select(c => new SelectListItem { Text = $"{c.StreetNumber} {c.StreetName}", Value = c.HouseId.ToString() }).ToList(); return(housesList); }
// GET: /<controller>/ public IActionResult Index(string searchTerm = null) { var houseViewModel = _houseService.GetAll(searchTerm) .Select(a => new HOMEIndexViewModel { HouseId = a.HouseId, StreetNumber = a.StreetNumber, StreetName = a.StreetName, Description = a.Description, CategoryName = a.CategoryName, FullName = a.FullName, ImageThumbnail = a.ImageThumbnail, InvoicesBalance = a.InvoicesBalance }).Where(o => o.InvoicesBalance > 10) .OrderByDescending(a => a.InvoicesBalance); bool isAjaxCall = HttpContext.Request.Headers["x-requested-with"] == "XMLHttpRequest"; if (isAjaxCall) { return(PartialView("_Houses", houseViewModel)); } return(View(houseViewModel)); }
public async Task <ActionResult <IEnumerable <HouseDto> > > GetHouses() { // TODO: Your code here await Task.Yield(); var houseEntities = _houseService.GetAll(); var response = _mapper.Map <IEnumerable <HouseDto> >(houseEntities); return(Ok(response)); }
public IActionResult GetAll() { var result = _houseService.GetAll(); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public async Task <IActionResult> HousesSection() { var sellableHouses = await _houseService.GetAll(); return(View(new HousesSectionViewModel() { Houses = _mapper.Map <IEnumerable <SectionHouseViewModel> >(sellableHouses), HousesMaxPrice = await _houseService.GetMaxHousePrice(), HousesMinPrice = await _houseService.GetMinHousePrice() })); }
public async Task <IActionResult> List() { await Task.Yield(); var model = new RentListViewModel() { Houses = _houseService.GetAll(), Features = _featureService.GetAll(), Provinces = _provinceService.GetAll() }; return(View(model)); }
public IActionResult Get() { try { var house = _houseService.GetAll(); var houseModels = house.Select(c => c.ToApiModel()); return(Ok(houseModels)); } catch (Exception ex) { ModelState.AddModelError("GetHouse", ex.Message); return(BadRequest(ModelState)); } }
public IHttpActionResult Get() { return(Ok(_houseService.GetAll())); }
public async Task <IActionResult> GetAll() { var houses = await _houseService.GetAll(); return(Ok(houses)); }
public IEnumerable <HouseDto> Get() { return(_houseService.GetAll()); }
public IActionResult Index() { var houses = _houseService.GetAll(User.Identity.GetId()); return(View(houses)); }
public IEnumerable <House> GetHouses() { return(_houseService.GetAll()); }
// GET: House public IActionResult List() { return(View(_houseService.GetAll())); }