Click here to Skip to main content
15,949,686 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:
(MainView)

<pre>CustomerDetails 

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

AddressType

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

AddressTable

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).

City

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

State

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

Country

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.

Thanks..
Posted
Updated 5-Nov-15 19:12pm
v2
Comments
Sinisa Hajnal 6-Nov-15 6:40am    
What have you tried?
Jameel VM 6-Nov-15 11:34am    
Please try this link..you will get an idea first
https://fromjami.wordpress.com/category/entityframework/

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