public CosmosService
        (
            ICosmosFactory cosmosFactory,
            IServiceProvider serviceProvider,
            IOptions <U> options,
            ITelemetryService telemetryService,
            IDateTimeService dateTimeService,
            ILoggingService <CosmosService <U> > logger
        )
        {
            _cosmosClient    = cosmosFactory.CreateCosmosClient(options.Value);
            _cosmosContainer = cosmosFactory.GetContainer(_cosmosClient, options.Value);

            _serviceProvider  = serviceProvider;
            _logger           = logger;
            _telemetryService = telemetryService;
            _dateTimeService  = dateTimeService;
        }
Exemplo n.º 2
0
 public SqlCosmosRepository(ICosmosFactory cosmosFactory)
 {
     _resiliencyPolicy = cosmosFactory.CreateResiliencyAsyncPolicy();
     _cosmosClient     = cosmosFactory.CreateCosmosClient();
     _container        = _cosmosClient.GetContainer(cosmosFactory.getDatabaseID(), cosmosFactory.getContainerID());
 }