如果使用Castle Active Record,我如何注入自己的ConnectionString?
答案 0 :(得分:1)
答案 1 :(得分:1)
IDbConnection connection = new SqlConnection("Data Source=.;Initial Catalog=TestB;Integrated Security=SSPI");
connection.Open();
using (new DifferentDatabaseScope(connection))
{
TestTableDatabaseA test3 = TestTableDatabaseA.Find(1);
Console.WriteLine(test3.Title);
}