public CosmosDBCertificateRequest(
     IApplicationsDatabase database,
     ICertificateGroup certificateGroup,
     IServicesConfig config,
     IDocumentDBRepository db,
     ILogger logger)
 {
     _applicationsDatabase = database;
     _certificateGroup     = certificateGroup;
     _log = logger;
     _certificateRequests = new DocumentDBCollection <CosmosDB.Models.CertificateRequest>(db, config.CosmosDBCollection);
     // set unique key in CosmosDB for Certificate ID ()
     // db.UniqueKeyPolicy.UniqueKeys.Add(new UniqueKey { Paths = new Collection<string> { "/" + nameof(CertificateRequest.ClassType), "/" + nameof(CertificateRequest.ID) } });
     _log.Debug("Created new instance of `CosmosDBApplicationsDatabase` service " + config.CosmosDBCollection);
 }
示例#2
0
 public CosmosDBApplicationsDatabase(
     ILifetimeScope scope,
     IServicesConfig config,
     IDocumentDBRepository db,
     ILogger logger)
 {
     _scope       = scope;
     _autoApprove = config.ApplicationsAutoApprove;
     _log         = logger;
     _log.Debug("Creating new instance of `CosmosDBApplicationsDatabase` service " + config.CosmosDBCollection, () => { });
     // set unique key in CosmosDB for application ID
     db.UniqueKeyPolicy.UniqueKeys.Add(new UniqueKey {
         Paths = new Collection <string> {
             "/" + nameof(Application.ClassType), "/" + nameof(Application.ID)
         }
     });
     _applications = new DocumentDBCollection <Application>(db, config.CosmosDBCollection);
 }