Пример #1
0
        public async Task <IActionResult> Create([Bind("ID,Nome")] Cliente cliente)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cliente);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cliente));
        }
Пример #2
0
 public async Task AddAsync(TEntity obj)
 {
     Db.Set <TEntity>().Add(obj);
     await Db.SaveChangesAsync();
 }