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();
            }
        }
예제 #2
0
 public void Update(T item)
 {
     context.Entry(item).State = EntityState.Modified;
 }