Beispiel #1
0
        public async Task <List <ServicePlanModel> > GetData(string whereQuery, string partition)
        {
            try
            {
                var response = await _cosmosDBOperationsRepository.GetItemsByQueryFromCollectionAsync(whereQuery, partition, collectionId, true);

                return(response);
            }
            catch (Exception e)
            {
                Inseego.Utils.Shared.ExceptionHandler.LogException("GetData had an issue", e);
                throw;
            }
        }
Beispiel #2
0
        public List <LicenseTypesResponse> LicenseTypes(string[] LicenseTypeids, string TenantId, string UserId)
        {
            string where = string.Empty;
            string selectLocationQuery = string.Empty;

            List <LicenseTypesResponse> response = new List <LicenseTypesResponse>();

            if (LicenseTypeids.Contains("all"))
            {
                selectLocationQuery = $"SELECT * FROM c where c.tenantId='" + TenantId + "' and c.userId='" + UserId + "' and c.isActive=true order by c.createdDate desc";
            }
            else
            {
                selectLocationQuery = $"SELECT * FROM c where c.id in ('" + String.Join(",", LicenseTypeids) + "') and c.tenantId='" + TenantId + "' and c.userId='" + UserId + "' and c.isActive=true order by c.createdDate desc";
            }
            List <LicenseTypesModel> data = _cosmosDBOperationsRepository.GetItemsByQueryFromCollectionAsync <LicenseTypesModel>(selectLocationQuery, where, TenantId, licenseTypeCollectionId).Result;

            if (data != null && data.Count != 0)
            {
                foreach (var item in data)
                {
                    LicenseTypesResponse idata = new LicenseTypesResponse();
                    CommonFunctions.CopyProperties(item, idata);
                    response.Add(idata);
                }
            }
            return(response);    //?.FirstOrDefault();
        }
Beispiel #3
0
        public async Task <List <ConsolidatedTripRecord> > GetData(string whereQuery, string partition)
        {
            try
            {
                var response = await _cosmosDBOperationsRepository.GetItemsByQueryFromCollectionAsync(whereQuery, partition, collectionId, true);

                return(response);
            }
            catch (Exception e)
            {
                Inseego.Utils.Shared.ExceptionHandler.LogException("CTRIndexFinalRepository had an issue", e);
                throw;
            }
        }