Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
5.00/5 (1 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"

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[^]
 
Share this answer
 
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
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
 
Share this answer
 

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