标签:false mic provider div using value .sql ef6 cti
https://msdn.microsoft.com/en-us/data/jj680699#Using
public class SQLiteConfiguration : DbConfiguration { public SQLiteConfiguration() { SetProviderFactory("System.Data.SQLite", SQLiteFactory.Instance); SetProviderFactory("System.Data.SQLite.EF6", SQLiteProviderFactory.Instance); Type t = Type.GetType( "System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6"); FieldInfo fi = t.GetField("Instance", BindingFlags.NonPublic | BindingFlags.Static); SetProviderServices("System.Data.SQLite", (DbProviderServices)fi.GetValue(null)); } }
[DbConfigurationType(typeof(SQLiteConfiguration))] public class AdminContext : DbContext { public AdminContext() : base("name=AdminContext") { } public AdminContext(DbConnection db) : base(db, false) { } public DbSet<User> User { set; get; } }
标签:false mic provider div using value .sql ef6 cti
原文地址:http://www.cnblogs.com/xthzb/p/6079820.html