Click here to Skip to main content
14,384,019 members
Rate this:
Please Sign up or sign in to vote.
Coders.................>

I am learning MVC. a And I am so beginner in MVC.

I have a question about that

How can I create a controller of View model as like I make a controller of model to access data from database


Is there any way to do that"????? please ans with appropriate link or tutorial.
Posted
Comments
rayhan12345 6-May-14 6:20am
   
sorry!! it will be "please ans with details or any link"
Rate this:
Please Sign up or sign in to vote.

Solution 1

haven't you follow any tutorials? you can use EF with MVC to access database. check below article
Linking to an Existing SQLDB in ASP MVC4.0 and EF5.x[^]
   
Comments
rayhan12345 6-May-14 6:49am
   
I can link a model with database and can create a controller of that model and can do CRUD operation on it. But I want to create a controller of viewModel to access . <br>
 <br>
Is it possible???? if yes, pls help
Rate this:
Please Sign up or sign in to vote.

Solution 2

Hello
http://msdn.microsoft.com/en-in/data/jj206878.aspx[^

Follow this. What you are talking about is Db first approach with EF. You will get a basic Idea on how to do.
Thanks
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100