Пример #1
0
        protected EfCoreBaseRepository(DbContext dbContext)
            : this(AccessPointProvider <DbContext> .Create(dbContext))
        {
            // For unit testing in memory db
            if (!dbContext.Database.ProviderName.Equals("Microsoft.EntityFrameworkCore.InMemory"))
            {
                // TODO: Attached-mode
                var dbConnection = dbContext.Database.GetDbConnection();

                // For attached scenario
                if (dbConnection.State == ConnectionState.Closed ||
                    dbConnection.State == ConnectionState.Broken)
                {
                    dbConnection.Open();
                }
            }
        }
Пример #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="clientWraper"></param>
 public AzureBaseBlobRepository(ICloudBlobWrapper clientWraper) : base(AccessPointProvider <ICloudBlobWrapper> .Create(clientWraper))
 {
 }