Answered by:
mysql entity framework 6

Question
-
User1144299848 posted
Hi Folks,
I am trying to learn mvc with mysql entity framework 6 code first. I am using VS 2013.
I am really a begginer in this matter.
There are many samples and tutorials around and I have tried some without success.
Can someone recomend a good one for start?
TIA
Moises Durovni
Friday, February 13, 2015 5:18 PM
Answers
-
User1144299848 posted
Finally, my first code first experience sarted.
For future reference I am using VS2013, mysql entity framework 6.
I used a modified version of the contoso university http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application.
In order to make it work I changed SchoolInitializer.cs from
class SchoolInitializer : System.Data.Entity.DropCreateDatabaseIfModelChanges<SchoolContext>
to
class SchoolInitializer : System.Data.Entity.DropCreateDatabaseAlways<SchoolContext>
Hope it helps somenone
Best regards
Moises
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, February 15, 2015 8:02 AM
All replies
-
User197322208 posted
MVC does not care about database. Please follow tutorials from http://www.asp.net/mvc
Then learn mysql in C#
Friday, February 13, 2015 5:53 PM -
User1144299848 posted
Hi Ignatandrei,
Thanks, but to use code first with mysql shouldn't I use mysql framework?
Tia
Moisés durovniFriday, February 13, 2015 6:44 PM -
User1144299848 posted
Finally, my first code first experience sarted.
For future reference I am using VS2013, mysql entity framework 6.
I used a modified version of the contoso university http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application.
In order to make it work I changed SchoolInitializer.cs from
class SchoolInitializer : System.Data.Entity.DropCreateDatabaseIfModelChanges<SchoolContext>
to
class SchoolInitializer : System.Data.Entity.DropCreateDatabaseAlways<SchoolContext>
Hope it helps somenone
Best regards
Moises
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, February 15, 2015 8:02 AM