在startup 添加数据库链接字符串

 services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("SqlServerConnection")));

原文地址:https://www.cnblogs.com/Blog-JJ/p/11328464.html