I am using asp.net mvc 4 + entity framework and for the first time I'm using ViewModels. I'm reading this tutorial: http://www.asp.net/mvc/overview/older-versions/mvc-music-store/mvc-music-store-part-8
After step in that it creates classes viewmodel, he's going to create the controller, but does not explain whether to create a migration to add these classes in the bank, it is necessary?
For I'm creating a migration like this:
add-migration xxx
But when the migration is created, the methods of up () and down () are coming empty, can anyone help me?
Migrations are used when you change database schema (= you change the classes that are used as models/entitites for your database). When you got empty up()
and down()
it means there were not any changes related to you entities classes.
So if you create database, then add some property for example to the OrderDetail
and add new migration, you should see in the up()
method code that will add new column for this new property.