Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions libraries/Microsoft.Bot.Builder.Azure/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Runtime.CompilerServices;

// Allows us to access some internal methods from the Microsoft.Bot.Builder.Azure.Tests unit tests so we don't have to use reflection and we get compile checks.
#if SIGNASSEMBLY
[assembly: InternalsVisibleTo("Microsoft.Bot.Builder.Azure.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
#else
[assembly: InternalsVisibleTo("Microsoft.Bot.Builder.Azure.Tests")]
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@ public CosmosDbPartitionedStorage(CosmosDbPartitionedStorageOptions cosmosDbStor
_jsonSerializer = jsonSerializer ?? throw new ArgumentNullException(nameof(jsonSerializer));
}

/// <summary>
/// Initializes a new instance of the <see cref="CosmosDbPartitionedStorage"/> class.
/// using the provided CosmosDB credentials, database ID, and collection ID.
/// </summary>
/// <param name="client">The custom implementation of CosmosClient.</param>
/// <param name="cosmosDbStorageOptions">Cosmos DB partitioned storage configuration options.</param>
internal CosmosDbPartitionedStorage(CosmosClient client, CosmosDbPartitionedStorageOptions cosmosDbStorageOptions)
: this(cosmosDbStorageOptions)
{
_client = client;
}

/// <summary>
/// Reads one or more items with matching keys from the Cosmos DB container.
/// </summary>
Expand Down Expand Up @@ -445,40 +457,58 @@ private bool IsInDialogState(JToken jToken) => jToken
/// <summary>
/// Internal data structure for storing items in a CosmosDB Collection.
/// </summary>
private class DocumentStoreItem : IStoreItem
internal class DocumentStoreItem : IStoreItem
{
/// <summary>
/// Gets the PartitionKey path to be used for this document type.
/// </summary>
/// <value>
/// The PartitionKey path to be used for this document type.
/// </value>
public static string PartitionKeyPath => "/id";

/// <summary>
/// Gets or sets the sanitized Id/Key used as PrimaryKey.
/// </summary>
/// <value>
/// The sanitized Id/Key used as PrimaryKey.
/// </value>
[JsonProperty("id")]
public string Id { get; set; }

/// <summary>
/// Gets or sets the un-sanitized Id/Key.
/// </summary>
/// <value>
/// The un-sanitized Id/Key.
/// </value>
[JsonProperty("realId")]
public string RealId { get; internal set; }

/// <summary>
/// Gets or sets the persisted object.
/// </summary>
/// <value>
/// The persisted object.
/// </value>
[JsonProperty("document")]
public JObject Document { get; set; }

/// <summary>
/// Gets or sets the ETag information for handling optimistic concurrency updates.
/// </summary>
/// <value>
/// The ETag information for handling optimistic concurrency updates.
/// </value>
[JsonProperty("_etag")]
public string ETag { get; set; }

/// <summary>
/// Gets the PartitionKey value for the document.
/// </summary>
/// <value>
/// The PartitionKey value for the document.
/// </value>
public string PartitionKey => this.Id;
}
}
Expand Down
Loading