开发者

Applying like filter to an IQueryable

I'm trying to write a custom filter for Dynamic data that will allow me to run like type queries on entity columns. For example searching for john on name field to returen johnson, johns etc.

I'm trying to override the IQueryable GetQueryable(IQueryable source) method on the QueryableFilterUserControl class. To filter my results. Does anyone know the best way of achieving this?

If this were and IQueryable<T> it would be easy as I could return the results of a .Where() clause.

There is an A开发者_运维知识库pplyEqualityFilter(IQueryable source, string Column.Name, object value) method on the QueryableFilterUserControl class but this performs a direct comparison.

Any help would be greatly appreciated.


have a look at my sample here Five Cool Filters for Dynamic Data 4

Also not that in both Linq to SQL and Entity Framework Contains is mapped to LIKE '%term%' in SQL.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜