Пример #1
0
 /// <summary>Initializes a new instance of the <see cref="ComponentController"/> class.</summary>
 /// <param name="settings">Settings for connecting to the database</param>
 public ComponentController(IBluprintrSettings settings)
 {
     if (settings != null)
     {
         this.driver = new Driver <Blueprint>(settings, "blueprints");
     }
 }
Пример #2
0
 /// <summary>Initializes a new instance of the <see cref="BlueprintController"/> class.</summary>
 /// <param name="settings">Settings for connecting to the database</param>
 public BlueprintController(IBluprintrSettings settings)
 {
     if (settings != null)
     {
         this.useMongo = settings.UseMongo;
         this.driver   = new Driver <Blueprint>(settings, "Blueprints");
     }
 }
Пример #3
0
 /// <summary>Initializes a new instance of the <see cref="ProjectController"/> class.</summary>
 /// <param name="settings">The settings used to connect to the database</param>
 public ProjectController(IBluprintrSettings settings)
 {
     if (settings != null)
     {
         this.useMongo = settings.UseMongo;
         this.driver   = new Driver <Project>(settings, "Projects");
     }
 }
Пример #4
0
 /// <summary>Initializes a new instance of the <see cref="Driver{T}"/> class.</summary>
 /// <param name="settings">Contains settings for connecting to the database</param>
 /// <param name="collection">The name of the collection in the database that will be accessed</param>
 public Driver(IBluprintrSettings settings, string collection)
 {
     if (settings != null)
     {
         this.items = new MongoClient(settings.BluprintrDatabaseSettings.MongoDBConnectionString)
                      .GetDatabase(settings.BluprintrDatabaseSettings.DatabaseName)
                      .GetCollection <T>(collection);
     }
 }
Пример #5
0
 /// <summary>Initializes a new instance of the <see cref="UserController"/> class.</summary>
 /// <param name = "config" >A configuration object used to set up keys for authentication</param>
 /// <param name = "settings">A settings object containing data for connecting to the database</param>
 public UserController(IConfiguration config, IBluprintrSettings settings)
 {
     this.config = config;
     this.auth   = new Authentication(config);
     if (settings != null)
     {
         this.useMongo = settings.UseMongo;
         if (this.useMongo)
         {
             this.driver = new Driver <User>(settings, "users");
         }
         else
         {
             // this.driver = new MSSQLDriver(settings);
         }
     }
 }