Пример #1
0
        private static FeedOptions SetPartitionKey <U>(U partitionKey, FeedOptions feedOptions)
        {
            feedOptions = feedOptions.ShallowCopy() ?? new FeedOptions();

            object pk = Implementation.CosmosDbRepository.IndirectlySupportedIndexTypes.Contains(partitionKey.GetType())
                ? (object)partitionKey.ToString()
                : partitionKey;

            feedOptions.PartitionKey = new PartitionKey(pk);
            return(feedOptions);
        }
Пример #2
0
 private static FeedOptions SetCrossPartition(FeedOptions feedOptions)
 {
     feedOptions = feedOptions.ShallowCopy() ?? new FeedOptions();
     feedOptions.EnableCrossPartitionQuery = true;
     return(feedOptions);
 }