public CosmosDbDataRepository(ICosmosDbConfiguration cosmosDbConfiguration, CosmosClient client) { _cosmosDbConfiguration = cosmosDbConfiguration ?? throw new ArgumentNullException(nameof(cosmosDbConfiguration)); _client = client ?? throw new ArgumentNullException(nameof(client)); }
public CosmosDbDataRepository(ICosmosDbConfiguration cosmosDbConfiguration, CosmosClient client, ILogger <CosmosDbDataRepository <T> > log) { _cosmosDbConfiguration = cosmosDbConfiguration ?? throw new ArgumentNullException(nameof(cosmosDbConfiguration)); _client = client ?? throw new ArgumentNullException(nameof(client)); _log = log ?? throw new ArgumentNullException(nameof(log)); }
public AccountRepository(ICosmosDbConfiguration cosmosDbConfiguration, CosmosClient client) : base(cosmosDbConfiguration, client) { }
public CarRepository(ICosmosDbConfiguration cosmosDbConfiguration, CosmosClient client, ILogger <CarRepository> logger) : base(cosmosDbConfiguration, client, logger) { }
/// <summary> /// Initializes a new instance of the <see cref="CosmosDbClientFactory"/> class. /// </summary> /// <param name="config">Configuration type of <see cref="ICosmosDbConfiguration"/>.</param> /// <param name="client">DocumentClient type of <see cref="IDocumentClient"/>.</param> public CosmosDbClientFactory(ICosmosDbConfiguration config, IDocumentClient client = null) { this.config = config; this.client = client ?? new DocumentClient(new Uri(config.Endpoint), config.AuthKey); }
public CarReservationRepository(ICosmosDbConfiguration cosmosDbConfiguration, CosmosClient client) : base(cosmosDbConfiguration, client) { }
public EnquiryRepository(ICosmosDbConfiguration cosmosDbConfiguration, CosmosClient client, ILogger <EnquiryRepository> log) : base(cosmosDbConfiguration, client, log) { }
public EnquiryRepository(ICosmosDbConfiguration cosmosDbConfiguration, CosmosClient client) : base(cosmosDbConfiguration, client) { }
/// <summary> /// Add Cosmos Db Repositories and Services. /// </summary> /// <param name="services">Service Collection.</param> /// <param name="config">Configuration type of <see cref="ICosmosDbConfiguration"/>.</param> /// <returns>Service Collection <see cref="IServiceCollection"/>.</returns> public static IServiceCollection AddCosmosDb(this IServiceCollection services, ICosmosDbConfiguration config) { services.AddSingleton(config); services.AddScoped <IDocumentClient>(s => new DocumentClient(new Uri(config.Endpoint), config.AuthKey)); services.AddScoped <IRepository, CosmosDbRepository>(); new CosmosDbClientFactory(config).EnsureDbSetupAsync().Wait(); return(services); }