예제 #1
0
        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();
                }
            }
        }
예제 #2
0
        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();
                }
            }
        }