Exemple #1
0
        internal static void SaveCoreTableItemSync <T>(T item, string tableName) where T : TableEntity
        {
            var table         = TableUtil.GetCoreTableReference(tableName);
            var saveOperation = TableOperation.InsertOrReplace(item);

            table.Execute(saveOperation);
        }
Exemple #2
0
        internal async Task <Organization> GetOrganization(string organizationId)
        {
            var table             = TableUtil.GetCoreTableReference(Tables.Organizations);
            var retrieveOperation = TableOperation.Retrieve <Organization>(partitionKey, organizationId);
            var tableResult       = await table.ExecuteAsync(retrieveOperation);

            return((Organization)tableResult.Result);
        }
Exemple #3
0
        internal Subscription GetSubscription(string subscriptionID)
        {
            var table             = TableUtil.GetCoreTableReference(typeof(Subscription).Name);
            var retrieveOperation = TableOperation.Retrieve <Subscription>(partitionKey, subscriptionID);
            var tableResult       = table.Execute(retrieveOperation);

            return((Subscription)tableResult.Result);
        }
Exemple #4
0
        internal List <Subscription> GetSubscriptionListByOrgId(string orgID)
        {
            var table  = TableUtil.GetCoreTableReference(typeof(Subscription).Name);
            var query  = new TableQuery <Subscription>().Where(TableQuery.GenerateFilterCondition("OrganizationId", QueryComparisons.Equal, orgID));
            var result = table.ExecuteQuery(query);

            if (result != null)
            {
                return(result.ToList());
            }
            return(null);
        }
Exemple #5
0
        internal List <PerUserTokenCache> GetPerUserTokenCacheListById(string User)
        {
            var table  = TableUtil.GetCoreTableReference(Tables.PerUserTokenCache);
            var query  = new TableQuery <PerUserTokenCache>().Where(TableQuery.GenerateFilterCondition("webUserUniqueId", QueryComparisons.Equal, User));
            var result = table.ExecuteQuery(query);

            if (result != null)
            {
                return(result.ToList());
            }
            return(null);
        }
Exemple #6
0
        internal Organization GetOrganizationByDomain(string domain)
        {
            var table  = TableUtil.GetCoreTableReference(Tables.Organizations);
            var filter = TableQuery.GenerateFilterCondition("VerifiedDomain", QueryComparisons.Equal, domain);
            var query  = new TableQuery <Organization>().Where(filter);
            var result = table.ExecuteQuery(query);

            if (result != null)
            {
                return(result.SingleOrDefault());
            }
            return(null);
        }
Exemple #7
0
        internal List <Subscription> GetEnrolledSubscriptionListByOrgId(string orgID)
        {
            var table = TableUtil.GetCoreTableReference(Tables.Subscription);

            string orgFilter        = TableQuery.GenerateFilterCondition("OrganizationId", QueryComparisons.Equal, orgID);
            string isEnrolledFilter = TableQuery.GenerateFilterConditionForBool("IsEnrolled", QueryComparisons.Equal, true);
            string combinedFilters  = TableQuery.CombineFilters(orgFilter, TableOperators.And, isEnrolledFilter);

            var query  = new TableQuery <Subscription>().Where(combinedFilters);
            var result = table.ExecuteQuery(query);

            if (result != null)
            {
                return(result.ToList());
            }
            return(null);
        }
Exemple #8
0
 internal static async Task DeleteCoreTableItem <T>(T item, string tableName) where T : TableEntity
 {
     var table           = TableUtil.GetCoreTableReference(tableName);
     var deleteOperation = TableOperation.Delete(item);
     await table.ExecuteAsync(deleteOperation);
 }
Exemple #9
0
 internal static async Task SaveCoreTableItem <T>(T item, string tableName) where T : TableEntity
 {
     var table         = TableUtil.GetCoreTableReference(tableName);
     var saveOperation = TableOperation.InsertOrReplace(item);
     await table.ExecuteAsync(saveOperation);
 }