public async Task <IActionResult> Edit(Guid id, [Bind("Id,Name")] Category category) { if (id != category.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(category); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CategoryExists(category.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(category)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,Name,Email,Phone,Description,Address,Zip,CityId,Site")] Investor investor) { if (id != investor.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(investor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InvestorExists(investor.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CityId"] = new SelectList(_context.City, "Id", "PrettyName", investor.CityId); return(View(investor)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,Name,Address,State,Zip,Description,Site,Phone,Email,CityId,CategoryId")] Business business) { if (id != business.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(business); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BusinessExists(business.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CategoryId"] = new SelectList(_context.Categories, "Id", "Name", business.CategoryId); ViewData["CityId"] = new SelectList(_context.City, "Id", "PrettyName", business.CityId); return(View(business)); }