Exemple #1
0
 public Type GetDatasetType(string datasetName)
 {
     if (DatasetTypes.ContainsKey(datasetName))
     {
         return(DatasetTypes[datasetName]);
     }
     throw new NotImplementedException($"{datasetName} is not defined");
 }
Exemple #2
0
 public object CreateDataset(string datasetName)
 {
     if (DatasetTypes.ContainsKey(datasetName))
     {
         try
         {
             Type type = DatasetTypes[datasetName];
             return(Activator.CreateInstance(type));
         }
         catch (ReflectionTypeLoadException e)
         {
             throw new Exception(string.Join(", ", e.LoaderExceptions.Select(x => x.Message)));
         }
     }
     throw new NotImplementedException($"{datasetName} is not defined");
 }