Click here to Skip to main content
15,880,503 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi i have one view and it contain 22 fields. My DB is fully normalized. I have 13 tables to save those 22 fields. I used Code First approach and ViewModel for insertion . I did same as like which is mentioned in the below link for insertion process

http://www.codeproject.com/Tips/651495/Inserting-Data-into-Multiple-Tables-using-Code-Fir

Now insertion is working fine now i want to do UPDATE, DELETE, INDEX process using codefirstapproach and ViewModel in MVC4 i donno how to do this . For Index i write Inner Join query . But for Update and Delete Process? i donno how to retreive data from multiple able for update and delete process. Please any one give me solution with one example.

Advance Thanks.
Posted

1 solution

Simply You need to understand
1. how to create context class and model class
2. How to create and communicate with controller and model
3. how to create view/ partial view.
also need to understand
Data annotation and/or fluent API

You can prefer following links....

Implementing Basic CRUD Functionality with the Entity Framework in ASP.NET MVC Application | The ASP.NET Site[^]
CRUD Operations Using Entity Framework 5.0 Code First Approach in MVC[^]

CRUD operation with Entity Framework 6 Code First approach in MVC 5[^]
C# Corner : Error Display[^]

CRUD Operations Using Entity Framework Code-First Approach[^]


I hope with the help of above link you can we meet your goal.
 
Share this answer
 
Comments
Member 12087373 5-Jan-16 23:37pm    
ok manoj let i have a check
Member 12087373 5-Jan-16 23:42pm    
Manoj mostly many article is like for single tables. but i have 13 tables. so only i got confusion
Dave Kreskowiak 6-Jan-16 0:07am    
You can only Update or Delete records in a single table at a time. There's really no difference between 1 table and 13 tables.
Member 12087373 6-Jan-16 0:13am    
how to do that . eg I have CustomerName, Age, Address, Street, location, City, state, Country, Contact no, email fields in my view. CustomerName and Age is saved in Customer table. Address City, State Street , Location is saved in AddressTable. Contact No Email are save in contact table. Now i want to update Address and Email and age of that particular customer means how to do this using code first approach
Dave Kreskowiak 6-Jan-16 0:21am    
Come on. You could have found that quite easily just by Googling for "entity framework delete record". It's been documented hundreds of thousands of times.

Google results[^]

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