ASP.NET中的Dapper,ODATA和IQueryable [英] Dapper, ODATA, and IQueryable in ASP.NET

查看:265
本文介绍了ASP.NET中的Dapper,ODATA和IQueryable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了Dapper的出色性能以及一些使用它的示例.

I saw the great performance of Dapper and some samples of how to use it.

我想知道是否可以使用它来提供IQueryable数据,并使用ODATA将其与UI层集成以将数据传输到UI(例如网格,列表等).

I was wondering if I can use it to provide IQueryable data and integrate it with UI layer using ODATA to transfer data to the UI (like grids, lists,...).

是否可以使用ODATA返回Dapper对象AsQueryable而不是IEnumerable?

Is there any way to return Dapper objects AsQueryable instead of IEnumerable to query using ODATA?

推荐答案

不,不是.好吧,如果您确实需要,可以使用.AsQueryable()包裹任何序列,但是它将仅使用LINQ-to-Objects. Dapper刻意简单.它尝试做的很少,但是它做了 尝试做的:它确实很好(即使我自己也这么说).正确的IQueryable接口与dapper完全相反...

No, not really. Well, you can wrap any sequence with .AsQueryable() if you really want, but it will just be using LINQ-to-Objects. Dapper is deliberately simple; it tries to do very little, but what it does try to do: it does damned well (even if I do say so myself). A proper IQueryable interface is the exact opposite of dapper...

这篇关于ASP.NET中的Dapper,ODATA和IQueryable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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