Exemple #1
0
 /// <summary>
 /// Load all ILCD data types in directory.
 /// </summary>
 /// <param name="dirName">Full path name of directory</param>
 /// <param name="ilcdSourceName">Name of ILCD data source</param>
 /// <param name="dbContext">Shared instance of DbContextWrapper</param>
 public void LoadAll(string dirName, string ilcdSourceName, DbContextWrapper dbContext, bool isPrivate)
 {
     if (dbContext.CreateDataSource(dirName, ilcdSourceName, isPrivate) != null) {
         // Improve load performance by disabling AutoDetectChanges.
         dbContext.SetAutoDetectChanges(false);
         LoadDataType(Path.Combine(dirName, "unitgroups"), dbContext);
         LoadDataType(Path.Combine(dirName, "flowproperties"), dbContext);
         LoadDataType(Path.Combine(dirName, "flows"), dbContext);
         LoadDataType(Path.Combine(dirName, "LCIAmethods"), dbContext);
         LoadDataType(Path.Combine(dirName, "processes"), dbContext);
         LoadDataType(Path.Combine(dirName, "sources"), dbContext);
         LoadDataType(Path.Combine(dirName, "contacts"), dbContext);
         dbContext.SetAutoDetectChanges(true);
     }
 }