Esempio n. 1
0
 public void Merge(DatasetInfo dataset)
 {
     if (this.Parent.Id != dataset.Parent.Id ||
         this.DataType != dataset.DataType)
     {
         throw new Exception("The datasets to be merged are not equal.");
     }
 }
Esempio n. 2
0
        public bool TryFindDataset(string path, out DatasetInfo dataset)
        {
            var pathParts = path.Split("/");

            if (pathParts.Length != 6)
            {
                throw new Exception($"The channel path '{path}' is invalid.");
            }

            var projectName = $"/{pathParts[1]}/{pathParts[2]}/{pathParts[3]}";
            var channelName = pathParts[4];
            var datasetName = pathParts[5];

            return(this.TryFindDatasetById(projectName, channelName, datasetName, out dataset));
        }
Esempio n. 3
0
        public bool TryFindDatasetById(string projectId, string channelId, string datsetId, out DatasetInfo dataset)
        {
            dataset = default;

            if (this.TryFindChannelById(projectId, channelId, out var channel))
            {
                dataset = channel.Datasets.FirstOrDefault(dataset => dataset.Id == datsetId);

                if (dataset != null)
                {
                    return(true);
                }
            }

            return(false);
        }