Skip to content

Added CodeFirst schema generation#1

Open
MitchellBot wants to merge 3 commits into
aml630:masterfrom
MitchellBot:master
Open

Added CodeFirst schema generation#1
MitchellBot wants to merge 3 commits into
aml630:masterfrom
MitchellBot:master

Conversation

@MitchellBot

Copy link
Copy Markdown

Added Database.EnsureCreated(); to a constructor for ProductCompareDbContext.
When the ProductCompareDbContext first gets called it will create the schema based on the present models.

  • Installation is simplified: One only needs to download, build and deploy the solution. The default VS SQL db will be used and the schema created automatically.
  • Tamper-resistant: Any changes to the schema from outside of the models will be overwritten on server restart.
  • Future-proof: Any changes to the models will automatically be reflected in the DB without manual intervention

Added database.ensurecreated() during construction of the DBContext.
This makes it more convenient to create any sort of DB needed as it is
the code-first generation of the DB schema.
Somehow broke the last build.
Verified changes - DB schema will create itself as long as it can
connect to the DB.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant