public IActionResult Location() { var locationList = _context.Locations .Select(location => new LocationListingModel { Id = location.Id, LocationName = location.LocationName, MyDotEmail = location.MyDotEmail, C4AccountName = location.C4AccountName }); var model = new LocationIndexModel { LocationList = locationList }; return(View(model)); }
public IActionResult Manage() { var userId = _userManager.GetUserId(User); var locationList = _context.Locations.Where(l => l.ApplicationUser.Id == userId) .Select(location => new LocationListingModel { Id = location.Id, LocationName = location.LocationName, MyDotEmail = location.MyDotEmail, C4AccountName = location.C4AccountName }); var model = new LocationIndexModel { LocationList = locationList }; return(View(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)); }