在OnModelCreating
函数中,我可以获取用于此DbConnection
实例的DbContext
对象,但是如何获取providerName
呢?
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
// this.Database.Connection ==> this returns the DbConnection object
// but I couldn't find the providerName
}
我找到了this question,但没有得到答案。
答案 0 :(得分:0)