77using SharpRepository . Repository . Queries ;
88using SharpRepository . Repository . Specifications ;
99using SharpRepository . Repository . Transactions ;
10+ using SharpRepository . Repository . Configuration ;
1011
1112namespace SharpRepository . Repository
1213{
@@ -19,8 +20,9 @@ namespace SharpRepository.Repository
1920 {
2021 protected readonly IRepository < T , TKey > Repository ;
2122
22- // we have 2 constructors so you can use the defualt sharpRepository section or specify a config section
23- // you can also provide the repository name from the config file instead of whatever the default is if needed
23+ // we have 3 constructors so you can use the defualt sharpRepository section or specify a config section
24+ // you can provide the repository name from the config file instead of whatever the default is if needed
25+ // you can also provide the configuration object instead of building one from the config file
2426 public ConfigurationBasedRepository ( string configSection , string repositoryName )
2527 {
2628 Repository = RepositoryFactory . GetInstance < T , TKey > ( configSection , repositoryName ) ;
@@ -32,6 +34,11 @@ public ConfigurationBasedRepository(string repositoryName = null)
3234 Repository = RepositoryFactory . GetInstance < T , TKey > ( repositoryName ) ;
3335 }
3436
37+ public ConfigurationBasedRepository ( ISharpRepositoryConfiguration configuration , string repositoryName = null )
38+ {
39+ Repository = RepositoryFactory . GetInstance < T , TKey > ( configuration , repositoryName ) ;
40+ }
41+
3542 public void Dispose ( )
3643 {
3744 Repository . Dispose ( ) ;
0 commit comments