// GET: Address/Edit/5 public ActionResult Edit(int id) { PrepareSelectList(); var entity = _addressLogic.GetById(id); AddressViewModel result = new AddressViewModel() { Id = entity.Id, Street = entity.Street, OwnerId = entity.OwnerId.HasValue ? entity.OwnerId.Value : 0, OwnerName = entity.ApplicationUser != null ? entity.ApplicationUser.FirstName + " " + entity.ApplicationUser.LastName : string.Empty, Number = entity.Number }; return(View(result)); }