/// <summary> /// Initializes a new instance of the <see cref="DocumentService"/> class. /// </summary> /// <param name="client">The <see cref="IDocumentClient"/> to use.</param> /// <param name="initializer">The <see cref="IDocumentCollectionInitializer"/> to use.</param> /// <param name="options">The <see cref="UserStoreOptions"/> to use.</param> /// <param name="logger">The <see cref="ILogger{DocumentService}"/> to use.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="client"/> or <paramref name="options"/> is <see langword="null"/>. /// </exception> /// <exception cref="ArgumentException"> /// <paramref name="options"/> is invalid. /// </exception> public DocumentService( CosmosClient client, IDocumentCollectionInitializer initializer, UserStoreOptions options, ILogger <DocumentService> logger) { _client = client ?? throw new ArgumentNullException(nameof(client)); _initializer = initializer ?? throw new ArgumentNullException(nameof(initializer)); _options = options; _logger = logger; }
/// <summary> /// Initializes a new instance of the <see cref="DocumentClientWrapper"/> class. /// </summary> /// <param name="initializer">The <see cref="IDocumentCollectionInitializer"/> to use.</param> /// <param name="telemetry">The <see cref="TelemetryClient"/> to use.</param> /// <param name="options">The <see cref="UserStoreOptions"/> to use.</param> /// <param name="logger">The <see cref="ILogger{DocumentClientWrapper}"/> to use.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="options"/> is <see langword="null"/>. /// </exception> /// <exception cref="ArgumentException"> /// <paramref name="options"/> is invalid. /// </exception> public DocumentClientWrapper( IDocumentCollectionInitializer initializer, TelemetryClient telemetry, UserStoreOptions options, ILogger <DocumentClientWrapper> logger) { _initializer = initializer ?? throw new ArgumentNullException(nameof(initializer)); _client = DocumentHelpers.CreateClient(options); _telemetry = telemetry; _options = options; _logger = logger; }