I use entity framework for first time ,use database first. I add the database in my application and don't to any thing except display data. My database has tables "Bus, Student, Gender, Course" after first run, I shoked that there is another tables created in the database like"Buses, courses, students, genders, Migration history". What is these tables and how it created?
1 Answers
You said you are using Database First approach. But you mentioned that you could see Migration History table in the database. This is not supposed to happen.
Database Firstapproach doesn't supportMigrations. It's only forCode FirstApproach. You are doing something seriously wrong w.r.t setting up EF in your project.Code Firstapproach creates tables in the plural naming from based on the Models you created. So you have models forBus,Student,Gender,Course. Hence it createdBuses,Students,Genders,Courses. It isCode First Approach.
First you need to get basic understanding of Entity Framework then you can decide which approach to use as per your requirements. You are mixing both approaches and which doesn't work.
https://www.asp.net/mvc/overview/getting-started/database-first-development/setting-up-database
- 4,783
- 7
- 49
- 90