Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have four tables Employee_Details,Employee_Contact_Details,Department_Wise_Employee and Skill_Wise_Employee.

I have to make one model from four different table entities.
So i have to write only one CRUD operation due to which all fours table get updated.
Posted

You can create a 'View' of all the 4 tables which will have selected fields from your 4 tables Employee_Details,Employee_Contact_Details,Department_Wise_Employee and Skill_Wise_Employee.Now create an entity model of your 'View' according to your attributes present in 'View'.For 'View' refer to following sites.

http://odetocode.com/articles/299.aspx[^]

http://www.w3resource.com/sql/creating-views/create-view-with-join.php[^]

You can write LINQ queries taking into account your entity model class corresponding to created View.Make sure that the View name in database should be same with your model entity class name.Then you can carry out CRUD operations as like as in normal entity models.
 
Share this answer
 
Quote:
You have to maintain relationship between all the four table's.
Then you have to add a ADO.NET Entity Framework in your project.
select all the required table's from your database.

And the last one is to use LINQ to SQL query for writing CURD query's
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900