Updating Entity Framework after updating the corresponding tables

  • After updating the columns in a Database you will have to update the entity model .edmx file by righ clicking on and selecting "Update Model From Database".

  • Updating the data model will update the corresponding tables codes(eg: ns_table_name under both Model1.Context.tt as well and Model1.tt).

  • The complex types generated from the stored procedures may not get updated[Busted bug in Entity Framework]. Follow the below steps, for a workaround,

    • Open the "Model Browser" window while you have the .edmx open.
    • In the EntityContainer node you should see a "Function Imports" node.
    • Inside this you'll see your Function Import mapped to your SPROC, double-click it to open the same window you used to create it, but now populated with its data.
    • Now, click "Get Column Information" (look at the grid below the button to see what will be changed), then the "Update" button next to the "Complex" radio button choice.
    • Click OK, and the Complex Type for your result set should be updated.

    Source :http://stackoverflow.com/questions/4995226/refreshing-a-stored-procedure-in-entity-framework-3-5
    Related: http://stackoverflow.com/questions/5982398/how-do-i-get-entity-framework-to-update-complex-types