private List <ShortId> LoadShortIds()
 {
     return(Task.Run(
                () =>
                dataApiClient.GetManyAsync <ShortId>(
                    $"Data.{nameof(ShortId.CollectionName)} = '{Model.DataType}' AND Data.{nameof(ShortId.OriginalId)} = '{Model.Id}'")
                .Result).Result);
 }
Example #2
0
        public async Task <IEnumerable <JObject> > GetManyAsync(string sqlWhereClause, string orderByClause = null, uint?limit = null)
        {
            EnsureLoggedIn();
            var combinedWhereClause = WhereClauseCombiner.CombinedWhereClause(parsedPermanentFilter, sqlWhereClause);
            var items = (await dataApiClient.GetManyAsync(CollectionName, combinedWhereClause, orderByClause, limit))
                        .Select(JObject.Parse)
                        .ToList();

            items.ForEach(item => cachedItems.AddOrUpdate(GetId(item), item, (key, existingItem) => item));
            return(items);
        }
        public override void Initialize()
        {
            base.Initialize();
            var postponedProcessingObjects = Task.Run(async() => await dataApiClient.GetManyAsync <PostponedProcessingObject>()).Result;

            foreach (var obj in postponedProcessingObjects)
            {
                postponedObjects.TryAdd(obj.Id, obj);
                RegisterInputType(obj.DataType);
            }
        }
Example #4
0
 private List <DataProjectUploadInfoViewModel> LoadAssociatedData()
 {
     return(Task.Run(
                () =>
     {
         var uploadInfos = dataApiClient.GetManyAsync <DataProjectUploadInfo>(
             $"Data.{nameof(DataProjectUploadInfo.DataProjectId)} = '{Model.Id}'").Result;
         return uploadInfos
         .OrderByDescending(x => x.UploadTimestamp)
         .Select(uploadInfo => new DataProjectUploadInfoViewModel(uploadInfo, dataApiClient, clipboard))
         .ToList();
     }).Result);
 }
Example #5
0
        private List <DataReferenceViewModel> LoadDataReferences()
        {
            var result = Task.Run(
                () =>
            {
                var taggedData = dataApiClient.GetManyAsync <DataTag>(
                    $"Data.{nameof(DataTag.TagName)} = '{Model.Id}'").Result;
                return(taggedData
                       .Select(tag => tag.DataReference)
                       .Select(dataReference => new DataReferenceViewModel(dataReference, dataApiClient))
                       .ToList());
            }).Result;

            return(result);
        }
        private async Task LoadPostponedObjects()
        {
            var missingDataTypes = new HashSet <string>();

            foreach (var postponedObject in await dataApiClient.GetManyAsync <PostponedProcessingObject>())
            {
                postponedObjects[postponedObject.Id] = postponedObject;
                foreach (var dataReference in postponedObject.MissingData)
                {
                    if (missingDataTypes.Contains(dataReference.DataType))
                    {
                        continue;
                    }
                    missingDataTypes.Add(dataReference.DataType);
                }
            }
        }
Example #7
0
 private List <DataServiceDefinition> LoadDataServiceDefinitions()
 {
     return(Task.Run(async() => await dataApiClient.GetManyAsync <DataServiceDefinition>()).Result.ToList());
 }