ā Unable to create a 'DbContext' of type 'ApplicationDbContext'.
hi š
i'm trying to structure my project with DDD model
but getting this error:
Unable to create a 'DbContext' of type 'ApplicationDbContext'. The exception 'The entity type 'IdentityUserLogin<string>' requires a primary key to be defined.
(this used to work before restructuring)
i'm adding db context in Project.Web/Program.cs
:
db context in Project.Infrastructure.Data
:
and ApplicationUser in Project.Domain.Entities.Identity
i've moved migration files to Project.Infrastructure/Data/Migrations
but now i can't do databtase update or make new migrations, or run the app8 Replies
I am not sure honestly as I am not that experienced but don't you just have to add the attribute [Key] to the model IdentityUserLogin
IdentityUserLogin is made by asp, not me
and it has a primary key already
i asked gippity, maybe the issiue is that you have to update the location of the migrations in the DI:
Otherwise I got no clue either and I am sorry if you already did that to lol š
Unknown Userā¢6d ago
Message Not Public
Sign In & Join Server To View
š« š«
yup
god damnit haha, the hallucinations as well when i tried to explain to gippity what the correct solution was as well xd
thank you š