在缓存数据上使用LINQ的CompiledQuery [英] CompiledQuery using LINQ on Cached Data

查看:80
本文介绍了在缓存数据上使用LINQ的CompiledQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Oracle 10g数据库中有一个小的(约16行,14列)静态查找表.我已将排序后的数据缓存到一个List对象中,以避免多次访问数据库,因为我处理了有关该数据的数千个请求.我创建了一个运行良好的LINQ查询对象,但是我仍然需要实现比所获得的性能更好的性能.

我发现了一些有关使用LINQ进行编译查询的文章,并认为这可能是我的性能问题的一种解决方案,因为查询本身并不会改变,仅会更改WHERE子句的参数.我发现的所有示例仍然引用数据库上下文/结构.

有人会告诉我如何在数组/列表上创建/使用已编译的Linq查询吗?

我看了那个例子.它使用一个datacontext对象.我需要使用列表或数组,或者找到一种方法来从列表中创建数据上下文,或者我完全丢失了什么?

I have a small (about 16 rows, 14 columns) static lookup table in an Oracle 10g database. I have cached the sorted data to a List object to avoid multiple trips to the database since I process thousands of requests on this data. I created a LINQ query object which works well but I still need to realize a better performance than what I''m getting.

I found some articles on compiled queries with LINQ and think it might be a solution to my performance issues since the query itself doesn''t change, only the parameters to the WHERE clause. All of the examples I''ve found still reference a database context/structure.

Would someone show me how to create/use a compiled Linq query on an array/list?

I looked at that example. It''s using a datacontext object. I need to use a list or array or find a way to create a data context out of a list or I''m totally missing something?

推荐答案

以下链接
编译查询(LINQ到实体) [ Linq Exchange [
Just look the following links
Compiled Queries (LINQ to Entities)[^]
Linq Exchange[^]


查看此链接

http://msdn.microsoft.com/en-us/vcsharp/aa336746 [ ^ ]
see this link

http://msdn.microsoft.com/en-us/vcsharp/aa336746[^]


希望 [
Hope this[^] might help you.


这篇关于在缓存数据上使用LINQ的CompiledQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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