开发者

When using Linq to EF, is EntityDataSource used much or raw Linq code used more often?

The EntityDataSource does not seem to provide much customizability at all, e.g. you ca开发者_如何学Pythonn't seem to be able to tweak the insert/update commands(or you don't have to?). Do professionals mostly write raw Linq code to use in conjunction with Databound controls like Repeater?


It depends on the scenario.

If you need a grid-like control, where users can view/edit/delete records (basically allowing them to directly modify DB records), then use a LinqDataSource.

If you want more control over the queries use Repeater and bind to a concrete List<T> (for example).

I prefer the latter, because it isolates logic into a DAL, where it can be tested and controlled more efficiently.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜