C
Join ServerC#
help
✅ EF Core Seeders
Bbarcode2/13/2023
How do I handle seeders in EF Core? Is there a way to split seeders away from migrations? Currently .HasData creates the insert in the migration
Bbarcode2/13/2023
Is there any better way?
JRJohnny Rage2/13/2023
What is your version of EFCore?
JJayy2/13/2023
I recently wrote a service to do this, i ripped the data out of our migrations
JJayy2/13/2023
I used this to do it on api startup
Bbarcode2/13/2023
7.0
Bbarcode2/13/2023
ty gonna check it out
JRJohnny Rage2/13/2023
Then look for docs, there should be method Seed()
Bbarcode2/13/2023
Bbarcode2/13/2023
I read this
Bbarcode2/13/2023
and it's not what I'm looking for
Bbarcode2/13/2023
it puts it in migrations
JRJohnny Rage2/13/2023
No, there should be another way
JRJohnny Rage2/13/2023
@barcode
JJayy2/13/2023
Yes this is what i was describing above using AsyncInitialization
JJayy2/13/2023
But you have to write it urself
AAccord2/14/2023
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.