Entityframework.docs: Make data seeding topic more helpful

Created on 1 Aug 2018  Â·  4Comments  Â·  Source: dotnet/EntityFramework.Docs

Helpfulness rating is very low.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

closed-duplicate good first issue help wanted punted-for-2.2

Most helpful comment

Comments from the feedback control about what's missing:

  • [ ] How to deploy to production.
  • [ ] How to seed AutoIncrement values; how to get some existing value from the database to perform some calculation onto inserting values.
  • [ ] How to convert data seeded with EnsureCreated to migrations.
  • [ ] How to seed an admin user account, for example how to handle password hashing.
  • [ ] Missing context for the code examples -- what class is OnModelCreating in, where does modelBuilder instance come from.

  • [ ] Plus several requests for more examples.

All 4 comments

Comments from the feedback control about what's missing:

  • [ ] How to deploy to production.
  • [ ] How to seed AutoIncrement values; how to get some existing value from the database to perform some calculation onto inserting values.
  • [ ] How to convert data seeded with EnsureCreated to migrations.
  • [ ] How to seed an admin user account, for example how to handle password hashing.
  • [ ] Missing context for the code examples -- what class is OnModelCreating in, where does modelBuilder instance come from.

  • [ ] Plus several requests for more examples.

For custom initialization logic it would be really nice to have an example of:

  • Deploying the initialization app with the main app, invoking the initialization routine and disabling or removing the initialization app.

It would also be nice to have an example of changing seed data and how to handle that with custom initialization. Even though changing seed data seems fairly straightforward if your only unique identifier is the auto generated key, how do you change seed data in the database if the keys differ on each environment?

Maybe even have a few EF core seeding examples that use Bogus: https://github.com/bchavez/Bogus

:sunglasses:

Closing in favor of #736

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ajcvickers picture ajcvickers  Â·  4Comments

MCcoder52 picture MCcoder52  Â·  3Comments

norvegec picture norvegec  Â·  3Comments

VirMaker picture VirMaker  Â·  4Comments

jpeckham picture jpeckham  Â·  3Comments