/// <summary>
        /// Gets the Queue Client Context.
        /// </summary>
        /// <param name="entityType">Type of the entity.</param>
        /// <param name="dataSource">The data source.</param>
        /// <returns>CloudQueueClient.</returns>
        public CloudQueueClient Get(Type entityType, string dataSource)
        {
            var connectionString = _sharedConnectionStringResolver.GetConnectionString(dataSource);
            var storageAccount   = CloudStorageAccount.Parse(connectionString);

            return(storageAccount.CreateCloudQueueClient());
        }
        /// <summary>
        /// Gets the options.
        /// </summary>
        /// <param name="sharedDataSource">The shared data source.</param>
        /// <returns>DbContextOptions.</returns>
        /// <exception cref="System.Configuration.ConfigurationErrorsException">SharedDataSource Type not found</exception>
        public DbContextOptions GetOptions(string sharedDataSource)
        {
            var conn    = new CosmosDbConnection(_sharedConnectionStringResolver.GetConnectionString(sharedDataSource));
            var builder = new DbContextOptionsBuilder <EFCoreDataContext>()
                          .UseCosmos(conn.AccountEndpoint, conn.AccountKey.ToUnsecureString(), conn.DatabaseName, (t) =>
            {
                //when they add some options to the class we may do some stuff here
            });

            return(builder.Options);
        }
Esempio n. 3
0
        /// <summary>
        /// Gets the options.
        /// </summary>
        /// <param name="sharedDataSource">The shared data source.</param>
        /// <returns>DbContextOptions.</returns>
        /// <exception cref="System.Configuration.ConfigurationErrorsException">SharedDataSource Type not found</exception>
        public DbContextOptions GetOptions(string dataSource)
        {
            var connectionString = _sharedConnectionStringResolver.GetConnectionString(dataSource);

            var builder = new DbContextOptionsBuilder <EFCoreDataContext>()
                          .UseSqlServer(connectionString, (t) =>
            {
                t.EnableRetryOnFailure();
            });

            return(builder.Options);
        }