Przemek Krzyżak
Przemek Krzyżak

Reputation: 21

How I can use LINQ in razor view?

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

Answers (1)

user2493313
user2493313

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

Related Questions