public async Task <bool> Edit(int id, Customer customer) { _context.Update(customer); await _context.SaveChangesAsync(); return(true); }
public void Update(DailyIntake item) { try { db.Update <DailyIntake>(item); } catch (Exception e) { Console.WriteLine(e); } }
public void Update(Balance_NG_3 item) { try { db.Update <Balance_NG_3>(item); } catch (Exception e) { Console.WriteLine(e); } }
public void Update(Directory_Metering_Units item) { try { db.Update <Directory_Metering_Units>(item); } catch (Exception e) { Console.WriteLine(e); } }
public void Update(DailyProduction item) { try { db.Update <DailyProduction>(item); } catch (Exception e) { Console.WriteLine(e); } }
public bool Update <TEntity>(TEntity entity) where TEntity : class { try { _dbContext.Update(entity); _dbContext.SaveChanges(); return(true); } catch (Exception e) { throw new InvalidDataException(e.Message); } }
public async Task <TEntity> UpdateAsync(TEntity entity) { if (entity == null) { throw new ArgumentNullException($"{nameof(AddAsync)} entity must not be null"); } try { _eFDbContext.Update(entity); await _eFDbContext.SaveChangesAsync(); return(entity); } catch (Exception) { throw new Exception($"{nameof(entity)} could not be updated"); } }
public IActionResult Put([FromBody, Required] Employee employee) { _efDbContext.Update(employee); _efDbContext.SaveChanges(); return(new OkObjectResult(employee)); }
public void Update(Category category) { _context.Update(category); _context.SaveChanges(); }
/// <summary> /// 更新记录 /// </summary> /// <typeparam name="TEntity"></typeparam> /// <param name="entity"></param> /// <param name="IsFind"></param> /// <returns></returns> public bool Update <TEntity>(TEntity entity, bool isFind) where TEntity : class { _dbContext.Update(entity); return(_dbContext.SaveChanges() > 0); }