Sneha K

Sneha K

  • 1.2k
  • 527
  • 196.9k

Crud Operation using CodeFirst approach in MVC4

Nov 6 2015 1:40 AM
I want to do CRUD Operation in MVC 4 or 5 using Store Procedure.

Eg MY DB Tables are:
(MainView)
 
CustomerDetails (MainView)  
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..




Answers (1)