public static void PopulateMeasures() { Measure currMeasure = null; using (DataSender.dbContext = new SuperMarketEntities()) { foreach (var measure in DataSender.measures) { currMeasure = new Measure(); currMeasure.MeasureID = measure.MeasureID; currMeasure.Name = measure.Name; dbContext.Measures.Add(currMeasure); dbContext.SaveChanges(); } } }
public static void PopulateMeasures() { Measure currMeasure = null; using (DataSender.dbContext) { foreach (var measure in DataSender.measures) { currMeasure = new Measure(); currMeasure.MeasureID = measure.MeasureID; currMeasure.Name = measure.Name; dbContext.SaveChanges(); } } }