public bool UpdateEngineStatus(String ShipperDuns, bool EngineStatus) { string conString = GetConStringByShipperDuns(ShipperDuns); try { using (UPRDEntities db = new UPRDEntities(conString)) { var settingResult = db.Setting.Where(s => s.Name.ToLower() == "iiteston").FirstOrDefault(); settingResult.Value = EngineStatus.ToString(); db.Entry(settingResult).State = EntityState.Modified; db.SaveChanges(); } return(true); } catch (Exception ex) { } return(false); }
public virtual void Update(T entity) { dbSet.Attach(entity); dataContext.Entry(entity).State = EntityState.Modified; }