Linq to SQL for WebMatrix(网页) [英] Linq to SQL for WebMatrix (Web Pages)

查看:109
本文介绍了Linq to SQL for WebMatrix(网页)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以在基于Webmatrix的站点(C#/Razor等)中使用Linq to SQL.我喜欢数据库搜索和其他东西,如果我可以使用Linq to SQL来做这件事-或至少返回行作为数据集或其他东西,然后在上面进行linq,那将是很棒的.基于WebMatrix的网站可以做到这一点吗?

I'm wondering if I can use Linq to SQL in my webmatrix-based sites (C#/Razor etc). I love database searching and stuff and it would be awesome if I could use Linq to SQL for that - or at the least, have rows returned, as a dataset or something and then linq over that. Is this possible with WebMatrix-based sites?

在WebMatrix的文档中,我还没有看到任何有关Linq的信息.

I haven't seen anything about Linq in the docs for WebMatrix.

推荐答案

您可以对Web Pages网站使用Linq To SQL或Entity Framework.我建议使用Visual Studio 2010 SP1或Visual Web Developer 2010 SP1,因为它们为Linq To SQL和Entity Framework提供了工具支持.我已经写了几篇关于带网页的实体框架的文章:

You can use Linq To SQL or the Entity Framework with Web Pages sites. I would recommend using Visual Studio 2010 SP1 or Visual Web Developer 2010 SP1 as they provide the tooling support for Linq To SQL and Entity Framework. I've written a couple of articles on Entity Framework with Web Pages:

http://www.mikesdotnetting. com/Article/182/Entity-Framework-Code-First-Development-With-WebMatrix

Entity Framework是Microsoft的ORM工具,受到了所有开发方面的关注.尽管LINQ to SQL并不是完全死胡同",但它并没有获得太多的关注.我认为,在这两种方式中,EF是必经之路.

Entity Framework is the ORM tool from Microsoft that's receiving all the development attention. While LINQ to SQL is not exactly "dead", it doesn't get as much love. Of the two, EF is the way to go, in my opinion.

这篇关于Linq to SQL for WebMatrix(网页)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆