Ejemplo n.º 1
0
        /// <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();
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="DocumentDBConnection" /> class.
 /// </summary>
 /// <param name="configuration">configuration</param>
 public DocumentDBConnection(DocumentDBConfiguration configuration)
 {
     this._configuration = configuration;
 }
Ejemplo n.º 3
0
 /// <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);
 }