开发者

Filter all entities based on common property in DynamicData application

I have dynamic data site based on EF CodeFirst context (using DynamicData.EFCodeFirstProvider library). Everything works, but all my entities inherit from one "开发者_开发百科common" entity that has (among others) a "IsDeleted" property. I want to filter items in dynamic data site based on this property (show only ones where IsDeleted == false). I have tried setting Where parameter of asp:EntityDataSource to item.IsDeleted, item.IsDeleted == false, item.IsDeleted = 0 and IsDeleted == false, but all I get is exception like this:

'item.IsDeleted' could not be resolved in the current scope or context. Make sure that all referenced variables are in scope, that required schemas are loaded, and that namespaces are referenced correctly.

As I figured out, this "Where" property accepts sql filter, and I don't know how to pass this argument. Resources I found online all use this property in combination with strongly typed asp:EntityDataSource and I'm wondering how to filter this thata and if this is the right place to do it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜