❔ facing error while pushing add migration command

connection string is created,dbcontext is inherited and added as service
9 Replies
phaseshift
phaseshift2y ago
Can your context be created normally when the app is running? You don't want to show your app-context code?
mer_nam hai bulla rakhta hu kula
no no not an issue
mer_nam hai bulla rakhta hu kula
my applicationDbcontext
FusedQyou
FusedQyou2y ago
How and when do you add the dbContext?
mer_nam hai bulla rakhta hu kula
here in program.cs
FusedQyou
FusedQyou2y ago
Can you move the optionsbuilder into your ApplicationDbContext using the void OnConfiguring(DbContextOptionsBuilder optionsBuilder) method?
FusedQyou
FusedQyou2y ago
You can inject your configuration. It would look something like this. In your case you will have an IConfiguration injected.
FusedQyou
FusedQyou2y ago
Probably doesn't matter, but either way.
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server