public static bool UpdateIbStrategyMapping(IBStrategyMapping ibmap) { using (wvDB entity = new wvDB()) { try { entity.Configuration.AutoDetectChangesEnabled = false; ibmap.LastUpdated = DateTime.Now; entity.IBStrategyMappings.AddOrUpdate(ibmap); entity.SaveChanges(); } finally { entity.Configuration.AutoDetectChangesEnabled = true; } return(true); } }
internal static void InsertIbStrategyMapping(List <IBStrategyMapping> newmapping) { using (wvDB entity = new wvDB()) { try { entity.Configuration.AutoDetectChangesEnabled = false; foreach (IBStrategyMapping ibmap in newmapping) { entity.IBStrategyMappings.Add(ibmap); } entity.SaveChanges(); } finally { entity.Configuration.AutoDetectChangesEnabled = true; } } }
public static bool UpdateIbStaticData(IEnumerable <IBStaticData> ibmaps) { using (wvDB entity = new wvDB()) { try { foreach (var ibmap in ibmaps) { entity.Configuration.AutoDetectChangesEnabled = false; ibmap.LastUpdated = DateTime.Now; entity.IBStaticDatas.AddOrUpdate(ibmap); } entity.SaveChanges(); } finally { entity.Configuration.AutoDetectChangesEnabled = true; } return(true); } }