简体   繁体   English

N层架构在哪里加载网格数据?

[英]N-tier architecture where loading data for grid?

In most managing application, you have to load a lot of data into datagrid not only for insert, update... but also for reports or just as lists. 在大多数管理应用程序中,您不仅必须将大量数据加载到datagrid中以进行插入,更新...,还需要将报告或列表中的数据加载到datagrid中。 In these datagrid, you can have data from different entities and that's why a "GetAll" from each entities is a bad approach. 在这些数据网格中,您可以拥有来自不同实体的数据,这就是为什么每个实体都使用“ GetAll”是一种不好的方法。

So what's the best way to load this kind of reports without having to load every data from every entities? 那么,加载此类报告而不必加载每个实体的每个数据的最佳方法是什么?

Because i uses Entity Framework, i can make a query to load only what i want, or even make a stored procedure, but in this case what's the best way to put this kind of loading into a n-tier application? 因为我使用的是Entity Framework,所以我可以进行查询以仅加载我想要的内容,甚至创建存储过程,但是在这种情况下,将这种类型的加载到n层应用程序中的最佳方法是什么? Which layer? 哪一层? A single class for all datagrid's data with one method for each datagrid? 对所有datagrid数据使用单一类,对每个datagrid使用一种方法? Or something else? 或者是其他东西?

您可能对使用开源N层实体框架感兴趣,该框架在服务器端使用Entity Framework,并生成用于基于WCF构建n层体系结构的整个基础结构,其中包括在客户端包含类似EF的API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM