public async Task <TEntity> UpdateAsync(TEntity entity) { if (entity == null) { throw new ArgumentNullException($"{nameof(UpdateAsync)} entity must not be null"); } try { DbContext.Update(entity); await DbContext.SaveChangesAsync(); return(entity); } catch (Exception ex) { throw new Exception($"{nameof(entity)} could not be updated {ex.Message}"); } }
public void UpdateTodo(Todo todoModels) { _context.Update(todoModels); _context.SaveChangesAsync(); }