Browse Source

修改IAzureCosmosDBV3Repository 的 FindByDict方法

李思淳 5 years ago
parent
commit
ca50770500

+ 2 - 21
TEAMModelOS.SDK/Module/AzureCosmosDBV3/AzureCosmosDBV3Repository.cs

@@ -373,12 +373,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
         {
 
             StringBuilder sql = new StringBuilder("select value(c) from c");
-            SQLHelperParametric.GetSQL(dict,sql);
-            CosmosDbQuery cosmosDbQuery = new CosmosDbQuery
-            {
-                QueryText = sql.ToString()
-
-            };
+            CosmosDbQuery cosmosDbQuery = SQLHelperParametric.GetSQL(dict,sql);
             QueryRequestOptions queryRequestOptions = GetDefaultQueryRequestOptions(itemsPerPage: GetEffectivePageSize(itemsPerPage, maxItemCount));
             return await ResultsFromQueryAndOptions<T>(cosmosDbQuery, queryRequestOptions);
         }
@@ -622,20 +617,6 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             return response.Resource;
         }
 
-
-        public async Task<List<T>> FindByDictTest<T>(Dictionary<string, object> dict, int itemsPerPage = 1, int? maxItemCount = 1, string partitionKey = null) where T : ID
-        {
-            //Container container = await InitializeCollection<T>();
-            StringBuilder sql = new StringBuilder("select value(c) from c");
-            CosmosDbQuery cosmosDbQuery = SQLHelperParametric.GetSQL(dict, sql);
-            QueryRequestOptions queryRequestOptions = GetDefaultQueryRequestOptions(itemsPerPage: GetEffectivePageSize(itemsPerPage, maxItemCount));
-
-            //FeedIterator<T> feedIterator = container
-            //   .GetItemQueryIterator<T>(cosmosDbQuery.CosmosQueryDefinition);
-            // return (await ResultsFromFeedIterator(feedIterator)).SingleOrDefault();
-
-
-            return await ResultsFromQueryAndOptions<T>(cosmosDbQuery, queryRequestOptions, maxItemCount);
-        }
+       
     }
 }

+ 0 - 1
TEAMModelOS.SDK/Module/AzureCosmosDBV3/IAzureCosmosDBV3Repository.cs

@@ -62,7 +62,6 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
         Task<List<dynamic>> FindByDict(string CollectionName, Dictionary<string, object> dict, int itemsPerPage = -1, int? maxItemCount = null, string partitionKey = null);
         Task<List<dynamic>> FindCountByDict(string CollectionName, Dictionary<string, object> dict, int itemsPerPage = -1, int? maxItemCount = null, string partitionKey = null);
         Task InitializeDatabase();
-        Task<List<T>> FindByDictTest<T>(Dictionary<string, object> dict, int itemsPerPage = -1, int? maxItemCount = null, string partitionKey = null) where T : ID;
 
 
     }