Hello all.. im complete beginner to MVC, im just stared learning Mvc through a book Hands on mvc.. and in that book a sample project is there.., it is "MovieReview" in which I used EF code first approach..so why im here is that i got exception while im doing that project... it throws an Exception when i run home controler index action "{"The entity or complex type 'MovieReview.Models.MovieViewModel' cannot be constructed in a LINQ to Entities query."}"..
i just upload my solution below MovieReview.rar file... plz Help me anyonee..
Thanks for advancee...
Nilesh SawardekarPosted Jul 6, 2016, 1:48 PM
You cannot (and should not be able to) project onto a mapped entity. You can, however, project onto an annonymous type or onto a DTO:
And your method will return a List of DTO's.
Have a look on above e.g.Shakti Singh DulawatPosted Jul 6, 2016, 6:23 AM