public async Task <IActionResult> Create([Bind("Id,Name,Description")] Service service) { if (ModelState.IsValid) { _context.Add(service); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(service)); }
public async Task <IActionResult> Create([Bind("Id,Name")] Customer customer) { if (ModelState.IsValid) { _context.Add(customer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(customer)); }
public async Task <IActionResult> Create([Bind("Id,Comments,ServiceId")] Contact contact) { if (ModelState.IsValid) { _context.Add(contact); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ServiceId"] = new SelectList(_context.Services, "Id", "Name", contact.ServiceId); return(View(contact)); }