private static void InitializeMeasures(QuantityDbContext db)
 {
     if (db.Measures.Count() != 0)
     {
         return;
     }
     db.Measures.AddRange(Measures);
     db.SaveChanges();
 }
Beispiel #2
0
 private static void initialize(Core.Units.Data measure, List <Core.Units.Data> units, QuantityDbContext db)
 {
     addMeasure(measure, db);
     addTerms(measure, db.MeasureTerms);
     addUnits(units, measure.Id, db);
     addTerms(units, db);
     addUnitFactors(units, SystemOfUnits.SiSystemId, db);
     db.SaveChanges();
 }
 private static void InitializeUnits(QuantityDbContext db)
 {
     if (db.Units.Count() != 0)
     {
         return;
     }
     db.Units.AddRange(TimeUnits);
     db.Units.AddRange(LenghtUnits);
     db.Units.AddRange(massUnits);
     db.Units.AddRange(TemperatureUnits);
     db.Units.AddRange(SubstanceUnits);
     db.Units.AddRange(LuminousUnits);
     db.Units.AddRange(CurrentUnits);
     db.SaveChanges();
 }