Tuesday, 8 March 2016

Beginning-with-database-approach-Part 3


In Part 2 of beginning with entity framework we did CRUD operation using entity framework. Now, there are few tips for using entity:


How to update your Entity Data Model (.edmx)?


Open your .edmx file >Right click >Select update from database
You will get this window:






















If you have added new table, views, stored procedure in database.. Select those and select Finish.
Same to update and delete from model.

Providing Default values?


In SQL we can provide default value, to a column, this default value is not automatically updated to our entity model. So we have to manual add the default value in our entity model also.
Select the table column from entity designer for which default value is to be provided.

Right click on the column>Properties >Default value :- Provide your value

























#Stored procedure of SQL behave as function in Entity framework.






No comments:

Post a Comment