public RepositoryFactory(ILogging.ILoggingFactory loggingFactory) { LoggingFactory = loggingFactory; if (theRepoFactory != null) { throw new ApplicationException( string.Format("An instance of the Type {0} is allready instantiated. Please use {0}.{1} instead", this.GetType().Name, this.GetPropertyName(() => theRepoFactory))); } MyConnectionString = ConfigurationManager.ConnectionStrings["EARTest"].ConnectionString; MyDbProviderName = ConfigurationManager.ConnectionStrings["EARTest"].ProviderName; RepoDbProvider = DbProviderFactories.GetFactory(MyDbProviderName); theRepoFactory = this; }
public BelegRepo(ILogging.ILoggingFactory logFactory) { Logger = logFactory.GetCurrentClassLogger(); myRepoFactory = RepositoryFactory.theRepoFactory as RepositoryFactory; }