public IActionResult LocationIndex(int locationId) { return(View( repo.GetAll() .Include(a => a.Address) .FirstOrDefault(l => l.Location_ID == locationId))); }
// GET: Map public ActionResult Index() { //List<LocationViewModel> lvm = repo.GetAll(); //foreach (var item in lvm) //{ // string base64String = Convert.ToBase64String(item.Picture, 0, item.Picture.Length); // item.Picture // Image1.ImageUrl = "data:image/png;base64," + base64String; //} if (Request.Cookies["OwnerId"] != null) { ViewBag.UserId = Request.Cookies["OwnerId"].Value; } return(View(repo.GetAll())); }
List <SelectListItem> SelectListItemsLocation(EditCarDetalisView vm) { var locationList = repoLocation.GetAll().Include(l => l.Address).Distinct().ToList(); var locationListSelected = new List <SelectListItem>(); foreach (var item in locationList) { string addresText = item.Address.ToString(); string id = item.Location_ID.ToString(); locationListSelected.Add(new SelectListItem { Text = addresText, Value = id }); } return(locationListSelected); }
public ViewResult LocationList() => View( repo.GetAll() .OrderBy(l => l.Location_ID) .Include(a => a.Address));