装了个Microsoft.EntityFrameworkCore.Sqlite 插件搞定,重新定义了Sqlite的DbContext如下
public class SqliteContentBase : Microsoft.EntityFrameworkCore.DbContext
{
static string dbPath1 = $"ask.db";
protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseSqlite($"Data Source={dbPath1}");
public Microsoft.EntityFrameworkCore.DbSet<AskContent> AskContent { get; set; }
}
实现了2种数据库的同时访问,搞来搞去搞好久。