Click here to Skip to main content
15,907,497 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I want to do CRUD Operation in MVC 4 or 5 using Store Procedure.

Eg MY DB Tables are:


CustomerName Uniqueidentifier  PrimaryKey not Null,
AddressTypeID Uniqueidentifier  null,
AddressLine1 varchar(100) null,
AddressLine2 varchar(100)null,
CityID Uniqueidentifier null,
StateID Uniqueidentifier null,
CountryIDUniqueidentifier null.
Pincode varchar(100) null.

SubView or AnotherView


AddressTypeID Uniqueidentifier  PrimaryKey not Null,
AddressTypeName varchar(100) null.


AddressID Uniqueidentifier  PrimaryKey not Null,
AddressTypeID Uniqueidentifier Null,
AddressLine1 varchar(100) null,
AddressLine2 varchar(100) null,
CityID Uniqueidentifier Null,
StateID Uniqueidentifier Null,
CountryID Uniqueidentifier Null, 
Pincode varchar(100).


CityID Uniqueidentifier  PrimaryKey not Null,
CityName varchar(100), 
StateID Uniqueidentifier Null.


StateID  Uniqueidentifier  PrimaryKey not Null, 
StateName varchar(100),
CountryID Uniqueidentifier Null.


CountryID  Uniqueidentifier  PrimaryKey not Null,
Country varchar(100)

CustomerDetails are MainView City ,State, Country AddressType are Sub views or Another Views.

I need to use the Sub Views(City, State, Country, AddressType) inside of Main View(CustomerDetails)

How to do CRUD Operation using Code First Approach with Store Procedure in Asp.Net MVC4 or 5 using Above Details..

Any one give me the solution using my Eg DB.

Updated 5-Nov-15 19:12pm
Sinisa Hajnal 6-Nov-15 6:40am    
What have you tried?
Jameel VM 6-Nov-15 11:34am    
Please try this will get an idea first

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