Reputation: 21
Could you tell me how can I use LINQ in razor view. I've added System.Data.Linq reference to my MVC project and I'm still not able to write my own queries.
Upvotes: 1
Views: 3253
Reputation: 31
You have to add @using System.Data.Linq
at the top of your view, or add <add namespace="System.Data.Linq" />
to the web.config in <system.web.webPages.razor><pages pageBaseType="System.Web.Mvc.WebViewPage"><namespaces>
section.
Have a nice day!
Upvotes: 2