public async Task <IActionResult> Create([Bind("Id,Name,Email")] 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,Description")] Room room) { if (ModelState.IsValid) { _context.Add(room); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(room)); }
public Customer Add(Customer entity) { db.Add(entity); db.SaveChanges(); return(entity); }
public Room Add(Room entity) { db.Add(entity); db.SaveChanges(); return(entity); }