/// <summary> /// Initializes a new instance of the <see cref="WebNotificationItemEntityRepository"/> class. /// </summary> /// <param name="cosmosDBSetting">The instance for <see cref="IOptions{CosmosDBSetting}"/>.</param> /// <param name="cosmosDBQueryClient">The instance for <see cref="ICosmosDBQueryClient"/>.</param> /// <param name="logger">The logger.</param> /// <param name="cosmosLinqQuery">The instance for <see cref="ICosmosLinqQuery"/>.</param> /// <exception cref="ArgumentNullException"> /// cosmosDBSetting /// or /// cosmosDBQueryClient /// or /// logger. /// </exception> public WebNotificationItemEntityRepository(IOptions <CosmosDBSetting> cosmosDBSetting, ICosmosDBQueryClient cosmosDBQueryClient, ILogger <WebNotificationItemEntityRepository> logger, ICosmosLinqQuery cosmosLinqQuery) { this.cosmosDBSetting = cosmosDBSetting?.Value ?? throw new ArgumentNullException(nameof(cosmosDBSetting)); this.cosmosDBQueryClient = cosmosDBQueryClient ?? throw new ArgumentNullException(nameof(cosmosDBQueryClient)); this.cosmosLinqQuery = cosmosLinqQuery ?? throw new ArgumentNullException(nameof(cosmosLinqQuery)); this.cosmosContainer = this.cosmosDBQueryClient.GetCosmosContainer(this.cosmosDBSetting.Database, this.cosmosDBSetting.Container); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
/// <summary> /// Initializes a new instance of the <see cref="EmailNotificationRepository"/> class. /// </summary> /// <param name="cosmosDBSetting">Cosmos DB Configuration.</param> /// <param name="cosmosDBQueryClient">CosmosDB Query Client.</param> /// <param name="logger">Instance of Logger.</param> /// <param name="cosmosLinqQuery">Instance of Cosmos Linq query.</param> /// <param name="mailAttachmentRepository">Instance of the Mail Attachment repository.</param> public EmailNotificationRepository(IOptions <CosmosDBSetting> cosmosDBSetting, ICosmosDBQueryClient cosmosDBQueryClient, ILogger logger, ICosmosLinqQuery cosmosLinqQuery, IMailAttachmentRepository mailAttachmentRepository) { this.cosmosDBSetting = cosmosDBSetting?.Value ?? throw new System.ArgumentNullException(nameof(cosmosDBSetting)); this.cosmosDBQueryClient = cosmosDBQueryClient ?? throw new System.ArgumentNullException(nameof(cosmosDBQueryClient)); this.cosmosContainer = this.cosmosDBQueryClient.GetCosmosContainer(this.cosmosDBSetting.Database, this.cosmosDBSetting.Container); this.logger = logger ?? throw new System.ArgumentNullException(nameof(logger)); this.cosmosLinqQuery = cosmosLinqQuery; this.mailAttachmentRepository = mailAttachmentRepository; }
/// <summary> /// Initializes a new instance of the <see cref="CosmosDBQueryClient"/> class. /// </summary> /// <param name="cosmosDBSetting">Cosmos DB configuration.</param> public CosmosDBQueryClient(IOptions <CosmosDBSetting> cosmosDBSetting) { this.cosmosDBSetting = cosmosDBSetting?.Value; this.cosmosClient = new CosmosClient(this.cosmosDBSetting.Uri, this.cosmosDBSetting.Key); }