I've been searching for a way, it may or may not be supported yet, I guess I'm looking for a concrete answer.
What I've been looking for is the solution for the following requirements:
- EFCore Code First Approach
- With existing database table with significant amount of data already in place
- Add a couple of columns to the said database table by updating my model
- No migrations through PM Console, just using Context with Fluent Api at application start
- No database recreation
- The approach can be: Check a configuration file or some sort, compare it against the version in a version table in database to trigger the update
- Project templates: Web Api 2, Uwp
If this is supported, is it advisable? If not, why? what are the disadvantages?
In my experience with the projects I was part of, either database first approach or code first but with database recreation.
The steps I have in mind are: - Update the model - Create migration objects - Update config file for db version - At application start, check the config version against version table - If versions do not match call Update() or Migrate() or both, with Migration objects/types as parameters