Esempio n. 1
0
        public async Task <IActionResult> Index()
        {
            using (var context = new efcoreContext())
            {
                var model = await context.Authors.AsNoTracking().ToListAsync();

                return(View(model));
            }
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("FirstName, LastName")] Author author)
        {
            using (var context = new efcoreContext())
            {
                context.Add(author);
                await context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
        }