|
@@ -680,11 +680,11 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- public async Task<IQueryable<dynamic>> FindByDict(string CollectionName, string PartitionKey, Dictionary<string, object> dict)
|
|
|
+ public IQueryable<dynamic> FindByDict(string CollectionName, Dictionary<string, object> dict)
|
|
|
{
|
|
|
- if (DocumentCollectionDict.TryGetValue(CollectionName, out _))
|
|
|
+ if (DocumentCollectionDict.TryGetValue(CollectionName, out DocumentCollection collection))
|
|
|
{
|
|
|
- await InitializeCollection(CollectionName, PartitionKey);
|
|
|
+ // collection = await InitializeCollection(CollectionName, "");
|
|
|
StringBuilder sql = new StringBuilder("select * from " + CollectionName + " c where 1=1 ");
|
|
|
if (dict != null)
|
|
|
{
|
|
@@ -694,7 +694,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
|
|
|
}
|
|
|
}
|
|
|
FeedOptions queryOptions;
|
|
|
- if (!string.IsNullOrEmpty(PartitionKey))
|
|
|
+ if (collection.PartitionKey.Paths.Count > 0)
|
|
|
{
|
|
|
queryOptions = new FeedOptions { MaxItemCount = -1, EnableCrossPartitionQuery = true };
|
|
|
}
|