Monday, February 24, 2014

Update EF when Model First


EF Updating....

Now most of us familiar with Code First in .net MVC. But in here what I am trying to explain is How to Update the Entity Framework when using Mode First in MVC. Although Code First is the latest trend, some applications still depends on Model first. 

Below steps are quick guide to follow up to Update EF

Double Click & Open edmx & then Click Model Browser
In the right side of the panel -> edmx -> Store -> Expand Complex / Function Imports / SP/Functions separately

Once you want to add / update tables & sps,
If they are existing components, Delete from Model all the related Complexs, Function Imports & Sps
Remember the all the names correctly & save each process


Click on SP & Update selected Sp from the model
Click on Add Function Import & Insert Correct Function Name then Select SPs correctly
Click Get Column Info : If no any Click OK


Specially in List_SPs, Click on Add Function Import then Insert Correct Function Name & Select SPs correctly
Click Get Column Info : List of columns in the table Click Complex Add Complex name correctly Click OK
Once Done go to Solution -> Common -> Entities -> Bp ->Model.tt 
Finally Right Click & Run Custom Tool


I think this will be helpful for you..

B' happy always....... :)

No comments:

Post a Comment