|
@ -48,14 +48,10 @@ namespace TaskManager.EntityFramework.Repository |
|
|
|
|
|
|
|
|
public async Task UpdateAsync(TEntity entity) |
|
|
public async Task UpdateAsync(TEntity entity) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//product 已前台更新后
|
|
|
//product 已前台更新后
|
|
|
|
|
|
|
|
|
_context.Attach(entity); |
|
|
_context.Attach(entity); |
|
|
_context.Entry(entity).State = EntityState.Modified; |
|
|
_context.Entry(entity).State = EntityState.Modified; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_dbSet.Update(entity); |
|
|
_dbSet.Update(entity); |
|
|
await _context.SaveChangesAsync(); |
|
|
await _context.SaveChangesAsync(); |
|
|
} |
|
|
} |
|
|