protected StoreBase(ICosmosClientAccessor clientAccessor, IOptions <DocumentDbOptions> options, string collectionName) { this.options = options.Value; container = clientAccessor.Client.GetContainer(options.Value.Database, collectionName); }
/// <summary> /// Initializes a new instance of the <see cref="DocumentDbUserStore{TUser}"/> /// </summary> /// <param name="documentClient">The DocumentDb client to be used</param> /// <param name="options">The configuraiton options for the <see cref="IDocumentClient"/></param> /// <param name="roleStore">The <see cref="IRoleStore{TRole}"/> to be used for storing and retrieving roles for the user</param> public DocumentDbUserStore(ICosmosClientAccessor clientAccessor, IOptions <DocumentDbOptions> options, IRoleStore <DocumentDbIdentityRole> roleStore) : base(clientAccessor, options, roleStore) { }
/// <summary> /// Initializes a new instance of the <see cref="DocumentDbRoleStore{TRole}"/> /// </summary> /// <param name="clientAccessor">The DocumentDb client to be used</param> /// <param name="options">The configuraiton options for the <see cref="IDocumentClient"/></param> public DocumentDbRoleStore(ICosmosClientAccessor clientAccessor, IOptions <DocumentDbOptions> options) : base(clientAccessor, options, options.Value.RoleStoreDocumentCollection ?? options.Value.UserStoreDocumentCollection) { }
/// <summary> /// Creates new repository instance. /// </summary> /// <param name="cosmosAccessor">The <see cref="CosmosClient"/> accessor.</param> /// <param name="databaseName">The working database name.</param> /// <param name="collectionName">The working container name.</param> protected Repository(ICosmosClientAccessor cosmosAccessor, string databaseName, string collectionName) { CosmosAccessor = cosmosAccessor; Container = CosmosAccessor.Client.GetContainer(databaseName, collectionName); }