Created
January 27, 2011 22:46
-
-
Save ilude/799465 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RepoConfiguration : Registry { | |
public RepoConfiguration() { | |
Scan(scan => { | |
scan.AssembliesFromApplicationBaseDirectory(); | |
scan.AddAllTypesOf<IRepository>().NameBy(type => type.Name.Replace("Repository", string.Empty)); // register SqlServerRepository with name SqlServer | |
}); | |
For<IRepository>().Use<SqlServerRepository>(); // define a default for no name calls | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// The problem is we have this
puhlic interface IRepository {}
puhlic interface IUserInterface : IRepository {}
public class SqlServerUserRepository : IUserRepository
public class OracleUserRepository : IUserRepository
Maybe putting queries in seperate classes might work better