Linq动态查询(如何创建通用搜索Winform以在所有实体中使用 [英] Linq dynamic query(how to create genric search winform to be use in all entities

查看:101
本文介绍了Linq动态查询(如何创建通用搜索Winform以在所有实体中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何开发通用搜索winform类以在EF应用程序的所有搜索中使用,搜索将确定实体的所有属性及其类型

How can develop a generic search winform class to be use in all search in EF application the search determine all the properties of entitiy and their type

推荐答案

我会使用存储库模式并公开IQueryable接口.这样做的好处是您可以查询EF上下文中的任何实体.我见过的最好的例子是:

RESTful WCF/EF POCO/工作单元/存储库/MEF:2之1 [
I would use the repository pattern and expose the IQueryable interface. The beauty of this means that you can query any entity in the EF context. The best example I have seen is:

RESTful WCF / EF POCO / Unit of Work / Repository / MEF: 1 of 2[^]


这篇关于Linq动态查询(如何创建通用搜索Winform以在所有实体中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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