Last post Jul 29, 2014 10:05 PM by Kevin Shen - MSFT
Jul 29, 2014 10:53 AM|bthJ6|LINK
I have a Domain Model and View Model. I need to use Entity Framework to get data for the View Model so that I can use IEnumerable to make a view. Can someone show me an example of how I can use EF to get the data, or a good tutorial?
Jul 29, 2014 04:16 PM|Mikesdotnetting|LINK
Do you know anything about using EF to get data? If so, how much? Can you provide examples of your domain model and the ViewModel you want to populate?
Jul 29, 2014 10:05 PM|Kevin Shen - MSFT|LINK
Based On my understanding, Sending a ViewModel to the view for rendering will work the same as when dealing with a model.
Since it's just a class, the view doesn't know, and doesn't care, where the model or ViewModel came from.
You can create the instance of the ViewModel class in the controller .
you can try the link below about how to use entityframe get data and set to your viewmodel
This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore,
Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you
completely understand the risk before retrieving any software from the Internet.