我正在使用带有实体框架,Asp.Net身份和IdentityServer4的Asp.Net Core 3.1。我正在尝试在多个项目中共享我的DbContext,但是我的代码优先迁移并不能满足我的需求。代码优先迁移有可能吗?我的设置是否完全精简?谢谢您的时间。
services.AddIdentity<AppUser, IdentityRole>()
.AddEntityFrameworkStores<AppUserContext>()
.AddDefaultTokenProviders();
...
services.AddDbContext<AppUserContext>(options => options.UseSqlServer(connectionString));
dotnet-ef migrations add Init -p User\User.csproj -c AppUserContext -s IdentityServer\IdentityServer.csproj
dotnet-ef migrations add Init -p Persistence\Persistence.csproj -c RecipeContext -s Application\Application.csproj
将AppUser和AppUserContext移动到IdentityServer。红色是受限制的端点。
我正在使用带有实体框架,Asp.Net身份和IdentityServer4的Asp.Net Core 3.1。我正在尝试在多个项目中共享我的DbContext,但是我的代码优先迁移并未产生我所想要的...
感谢@RuardvanElburg的建议,我通过更改我的范式来“解决”了这个问题,您可以在我的Update 1