This question seems unrelated to Radzen and we can't provide assistance for it. I recommend looking online for Entity Framework Core Migrations related resources.
Hi @kim,
I'm facing the same problem and managed to solve it.
Why the only tables that are being created/updated are the Identity ones? this is because the "Database.Migrate" only call for the "identityDbContext", you can see it at the lower part of Startup.cs code:
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
endpoints.MapControllers();
endpoints.MapBlazorHub();
endpoints.MapFallbackToPage("/_Host");
});
//migration only call for this context
identityDbContext.Database.Migrate();
OnConfigure(app, env);
So you should call migration for your datasource context manually by extend the partial class onConfigure(app, env).
Below are steps that are working for me:
create code first migration by targeting specific context and specific output directory. why? because there are more than one context, so we should told migration which one should be created and to what directory. below is the add migration command example: