コード例 #1
0
ファイル: StudySeed.cs プロジェクト: equinor/sepes-api
        //public static void AddDatasetsIfWanted(bool addDatasets, Study study)
        //{
        //    if (addDatasets)
        //    {
        //        for (var counter = 0; counter <= 2; counter++)
        //        {
        //            var datasetName = $"ds-{counter}";
        //            var datasetClassification = (DatasetClassification)counter;

        //            study.StudyDatasets.Add(DatasetFactory.CreateStudySpecificRelation(study, datasetName, TestConstants.REGION, datasetClassification.ToString()));
        //        }
        //    }
        //}

        public static void AddDatasetsIfWanted(bool addDatasets, Study study)
        {
            if (addDatasets)
            {
                for (var counter = 0; counter <= 2; counter++)
                {
                    var datasetName           = $"ds-{counter}";
                    var datasetClassification = (DatasetClassification)counter;

                    var datasetRelation = DatasetFactory.CreateStudySpecificRelation(study, datasetName, TestConstants.REGION, datasetClassification.ToString());
                    study.StudyDatasets.Add(datasetRelation);
                }
            }
        }