Exemple #1
0
        public void Delete(TEntity entityToDelete)
        {
            if (Db.Entry(entityToDelete).State == EntityState.Detached)
            {
                DbSet.Attach(entityToDelete);
            }

            DbSet.Remove(entityToDelete);
        }
 public async Task UpdateAsync(T entity)
 {
     _dbContext.Entry(entity).State = EntityState.Modified;
     await _dbContext.SaveChangesAsync();
 }
Exemple #3
0
 public ActionResult Put(int id, [FromBody] Ticket ticket)
 {
     context.Entry(ticket).State = EntityState.Modified;
     context.SaveChanges();
     return(Ok());
 }