public IActionResult EditProperty(House house, IFormFile fileSelect) { //Edit house in database using (var target = new MemoryStream()) { fileSelect.CopyTo(target); house.PhotoData = target.ToArray(); } List <House> Properties; using (IPropertyRepository propRep = new PropertyRepository()) { propRep.EditHouse(house); Properties = propRep.PopulateHouses(); } return(View("~/Views/Property/Houses.cshtml", Properties)); }