public Type GetDatasetType(string datasetName) { if (DatasetTypes.ContainsKey(datasetName)) { return(DatasetTypes[datasetName]); } throw new NotImplementedException($"{datasetName} is not defined"); }
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"); }