我跟着從here爲Asp.Net核心和EF核心的教程一步一步腳手架的DbContext只創建masterContext沒有別的
工作正常的LocalDB但是當我嘗試在Azure上一樣,我只能得到一個局部類 「masterContext」
public partial class masterContext : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.
optionsBuilder.UseSqlServer(@"connectionString");
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
}
}
我上的NuGet運行的命令是
腳手架的DbContext 「服務器= TCP:dbName.database.windows.net,1433;堅持安全 Info = False;用戶 ID = user; Password = pass; MultipleActiveResultSets = False; Encrypt = True; TrustServerCertificate = False;連接 Timeout = 30;「 Microsoft.EntityFrameworkCore.SqlServer -outputdir 實體-force
我試圖重新啓動Visual Studio中的推薦的解決方案但沒有做任何事情。有什麼建議麼 ?