Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

In certain scenario, you might want to extend the pre-defined data model by adding a column or table in the database. There are 2 ways to do that.

To add a new property on an existing model

  1. EF Code first

    Go to project BeYourMarket.Model, find the entity that you would like to add a property. e.g. Category.cs. Then add the property to the model and update the corresponding mapping class CategoryMap.cs in the Mapping folder. Finally, update the database with migrations.

    For more info on EF code first, please visit Code First to a New Database.

  2. Database first

    It's a easier way but require Entity Framework Power Tools in Visual Studio. Open Sql Management Studio, add new column to the table. Then in the Visual Studio, right click on the project BeYourMarket.Model, choose Entity Framework->Reverse Engineer Code First. It would then update the model accordingly.




  • No labels