public async Task Update(T t) { T item = await _context.Set <T>().FindAsync(t.ResourceId, t.UserId); if (item != null) { _context.Entry(item).CurrentValues.SetValues(t); _context.Entry(item).State = EntityState.Modified; await Save(); } }
public void Update(T item) { context.Entry(item).State = EntityState.Modified; }