public async Task <IActionResult> Index() { using (var context = new efcoreContext()) { var model = await context.Authors.AsNoTracking().ToListAsync(); return(View(model)); } }
public async Task <IActionResult> Create([Bind("FirstName, LastName")] Author author) { using (var context = new efcoreContext()) { context.Add(author); await context.SaveChangesAsync(); return(RedirectToAction("Index")); } }