这个问题是关于使用https://github.com/maxtoroq/DbExtensions
DbConnection connection = Database.CreateConnection("name=myconx");
var query = SQL.SELECT("u.username").FROM("Users u").WHERE("Id={0}", 1);
IEnumerable<Users> products = connection.Map<Users>(query);
以下代码返回 null 不知道为什么?
getDbProviderFactory(connection);
这是不知道下一个代码用途的定义:
static readonly Func<DbConnection, DbProviderFactory> getDbProviderFactory =
(Func<DbConnection, DbProviderFactory>)Delegate.CreateDelegate(typeof(Func<DbConnection, DbProviderFactory>), typeof(DbConnection).GetProperty("DbProviderFactory", BindingFlags.Instance | BindingFlags.NonPublic).GetGetMethod(nonPublic: true));
这是我的连接字符串
<add name="myconx" connectionString="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=ES;Initial Catalog=TestDB;Data Source=ITA-PC\SQLR2" providerName="System.Data.OleDb"/>