public IActionResult AllLocations() { AllLocationsViewModel model = new AllLocationsViewModel(); model.Locations = locationRepository.GetAll().Include(l => l.Admin) .Include(l => l.LocationCategory); GetAllCategories(model); return(View(model)); }
private AddEventViewModel GetAllLocations(AddEventViewModel model) { var locations = locationRepository.GetAll(); foreach (var location in locations) { model.Locations.Add(new SelectListItem { Text = location.Title, Value = location.Id.ToString() }); } return(model); }
public CreateNewTaskViewModel GetLocations(CreateNewTaskViewModel model) { var locations = locationRepository.GetAll(); foreach (var location in locations) { model.Locations.Add(new SelectListItem { Text = location.Title, Value = location.Id.ToString() }); } return(model); }
public IActionResult Index(int id) { var location = _locationService.GetAll(); var listingResult = location .Select(l => new LocationListingModel { Id = l.Id, LocationName = l.LocationName, LocationAddress = l.LocationAddress, LocationMap = l.LocationMapUrl }); var model = new LocationIndexModel() { LocationListing = listingResult }; return(View(model)); }