/// <summary> /// Initializes a new instance of the <see cref="DocumentDBBox" /> class. /// </summary> /// <param name="configuration">configuration</param> private DocumentDBBox(DocumentDBConfiguration configuration) { this._configuration = configuration ?? new DocumentDBConfiguration(); this.Pool = new ConnectionPool { PoolSize = this._configuration.PoolSize }; this.Pool.Initialize(new DocumentDBConnection(this._configuration)).Wait(); }
/// <summary> /// Initializes a new instance of the <see cref="DocumentDBConnection" /> class. /// </summary> /// <param name="configuration">configuration</param> public DocumentDBConnection(DocumentDBConfiguration configuration) { this._configuration = configuration; }
/// <summary> /// Lazy Instance Value /// </summary> /// <param name="configuration">configuration</param> /// <returns> /// <see cref="DocumentDBBox" /> /// </returns> public static DocumentDBBox GetInstance(DocumentDBConfiguration configuration = null) { return((_instance ?? (_instance = new Lazy <DocumentDBBox>(() => new DocumentDBBox(configuration)))).Value); }