Skip to content

Commit

Permalink
I'm attempting to use the library in a Multi Tenant scenario where ea…
Browse files Browse the repository at this point in the history
…ch tenant connects to their own specific Cosmos DB (#428)

Along with the previous change I did to make ICosmosClientProvider public (#398)

* made ICosmosContainerProvider public
The Default implementation caches containers, I needed a custom implementation to cache these per Tenant
* Repository option
- I made DatanaseId, ContainerId and connection string virtual
Again in my implementation I need these to be tenant specific, making these virtual allows me over replace this with a MultiTenant version on RepositoryOptions
  • Loading branch information
joelsteventurner committed Apr 10, 2024
1 parent 6e2204e commit a27d6ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class RepositoryOptions
/// <summary>
/// Gets or sets the cosmos connection string. Primary or secondary connection strings are valid.
/// </summary>
public string? CosmosConnectionString { get; set; }
public virtual string? CosmosConnectionString { get; set; }

/// <summary>
/// Gets or sets the cosmos account endpoint URI. This can be retrieved from the Overview section of the Azure Portal.
Expand All @@ -39,15 +39,15 @@ public class RepositoryOptions
/// <remarks>
/// Defaults to "database", unless otherwise specified.
/// </remarks>
public string DatabaseId { get; set; } = "database";
public virtual string DatabaseId { get; set; } = "database";

/// <summary>
/// Gets or sets the name identifier for the cosmos container that corresponds to the <see cref="DatabaseId"/>.
/// </summary>
/// <remarks>
/// Defaults to "container", unless otherwise specified.
/// </remarks>
public string ContainerId { get; set; } = "container";
public virtual string ContainerId { get; set; } = "container";

/// <summary>
/// Gets or sets whether to optimize bandwidth.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Microsoft.Azure.CosmosRepository.Providers;
/// The cosmos container provider exposes a means of providing
/// an instance to the configured <see cref="Container"/> object.
/// </summary>
interface ICosmosContainerProvider<TItem> where TItem : IItem
public interface ICosmosContainerProvider<TItem> where TItem : IItem
{
/// <summary>
/// Asynchronously gets the configured <see cref="Container"/> instance that corresponds to the
Expand Down

0 comments on commit a27d6ca

Please sign in to comment.