Пример #1
0
 public DocumentDBProjectsRepository(IOptions <PortfolioSettings> settings)
 {
     this.settings = settings.Value;
     this.client   = new DocumentClient(new Uri(this.settings.DatabaseEndpoint), this.settings.DatabaseKey);
     CreateDatabaseIfNotExistsAsync().Wait();
     CreateCollectionIfNotExistsAsync().Wait();
 }
Пример #2
0
 public MongoDBProjectsRepository(IOptions <PortfolioSettings> settings)
 {
     this.settings   = settings.Value;
     this.client     = new MongoClient(this.settings.DatabaseEndpoint);
     this.database   = this.client.GetDatabase(this.settings.DatabaseId);
     this.collection = this.database.GetCollection <Project>(this.settings.CollectionId);
 }
 public ProjectsController(IProjectsRepository reporitory, IOptions <PortfolioSettings> settings)
 {
     this.projectsRepository = reporitory;
     this.settings           = settings.Value;
 }