请问关于c的具体应用场景有哪些?
- 内容介绍
- 文章标签
- 相关推荐
本文共计294个文字,预计阅读时间需要2分钟。
我的扩展方法是:`public static IEnumerable FilterCultureSubQuery(this Table t) where T : class { return t; }`
我尝试在查询中使用它:`var test=from p in t.Products select new { Allo=p, Allo2=(from pl in t.Produc`
我的扩展方法是:public static IEnumerable<T> FilterCultureSubQuery<T>(this Table<T> t) where T : class { return t; }
我试图在这个查询中使用它
var test = from p in t.Products select new { Allo = p, Allo2 = (from pl in t.ProductLocales.FilterCultureSubQuery() select pl) };
什么应该是我的方法扩展的签名?我总是得到这个错误:
Method 'System.Collections.Generic.IEnumerable`1[ProductLocale] FilterCultureSubQuery[ProductLocale](System.Data.Linq.Table`1[ProductLocale])' has no supported translation to SQL.
我也试过这个签名:
public static IQueryable<T> FilterCultureSubQuery<T>(this Table<T> t) where T : class { return t; }
我收到了这个错误:
Method 'System.Linq.IQueryable`1[ProductLocale] FilterCultureSubQuery[ProductLocale](System.Data.Linq.Table`1[ProductLocale])' has no supported translation to SQL.
谢谢
你方法的签名很好.问题是,如上所述,它“没有支持的SQL转换”.DLINQ正在尝试将该语句转换为将发送到数据库的SQL行.该方法没有翻译.
我建议使用Where子句重写过滤器.
本文共计294个文字,预计阅读时间需要2分钟。
我的扩展方法是:`public static IEnumerable FilterCultureSubQuery(this Table t) where T : class { return t; }`
我尝试在查询中使用它:`var test=from p in t.Products select new { Allo=p, Allo2=(from pl in t.Produc`
我的扩展方法是:public static IEnumerable<T> FilterCultureSubQuery<T>(this Table<T> t) where T : class { return t; }
我试图在这个查询中使用它
var test = from p in t.Products select new { Allo = p, Allo2 = (from pl in t.ProductLocales.FilterCultureSubQuery() select pl) };
什么应该是我的方法扩展的签名?我总是得到这个错误:
Method 'System.Collections.Generic.IEnumerable`1[ProductLocale] FilterCultureSubQuery[ProductLocale](System.Data.Linq.Table`1[ProductLocale])' has no supported translation to SQL.
我也试过这个签名:
public static IQueryable<T> FilterCultureSubQuery<T>(this Table<T> t) where T : class { return t; }
我收到了这个错误:
Method 'System.Linq.IQueryable`1[ProductLocale] FilterCultureSubQuery[ProductLocale](System.Data.Linq.Table`1[ProductLocale])' has no supported translation to SQL.
谢谢
你方法的签名很好.问题是,如上所述,它“没有支持的SQL转换”.DLINQ正在尝试将该语句转换为将发送到数据库的SQL行.该方法没有翻译.
我建议使用Where子句重写过滤器.

