Beispiel #1
0
 public async Task Editar(int id, TEntity e)
 {
     e.UpdatedData = DateTime.Now;
     _db.Set <TEntity>().Update(e);
     _db.Entry(e).Property(x => x.CreatedDate).IsModified = false;
     await _db.SaveChangesAsync();
 }
        public async Task <IActionResult> Create([Bind("Nome,Telefone,Id,DateUpdate,DateCreate")] Tutor tutor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tutor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tutor));
        }