I'm trying to test some code in LINQPad. However, the base
class calls Configuration Manager. How can I simulate that when testing in LINQPad.
void Main()
{
var tRepo = new TestRepository();
var result = tRepo.GetAsync(1);
result.Dump();
}
public partial class TestRepository : BaseRepository<Customer>, ICustomerRepository
{
// Here base throws the errror
public TestRepository() : base("DbConnString")
{
}
}
Here's the constructor for BaseRepository (from a compiled DLL, so not editable in LINQPad):
protected BaseRepository(string connectionStringName)
{
var connectionString = ConfigurationManager.ConnectionStrings[connectionStringName];
Connection = new SqlConnection(connectionString.ConnectionString);
Connection.Open();
}