内容目录
For context classes, there should be an overloaded base(options)
constructor.
public partial class DatabaseContext : DbContext { public DatabaseContext() { }
public DatabaseContext(DbContextOptions<DatabaseContext> options) : base(options) { }
}
Usage
var optionsBuilder = new DbContextOptionsBuilder<DatabaseContext>(); optionsBuilder.UseSqlite("filename=C:\666.db"); DatabaseContext context = new DatabaseContext(optionsBuilder.Options);
文章评论