public async Task <IActionResult> Create([Bind("Title, AuthorId")] Book book) { using (var context = new MCPContext()) { context.Books.Add(book); await context.SaveChangesAsync(); return(RedirectToAction("Index")); } }
public async Task <IActionResult> Create([Bind("FirstName, LastName")] Author author) { using (var context = new MCPContext()) { context.Add(author); await context.SaveChangesAsync(); return(RedirectToAction("Index")); } }