Windows Phone 7 中关于提升LocalDataBase性能的分析

1. Compiled Query

Func<OfflineDataContext, int> getNewsCount =
                    CompiledQuery.Compile((OfflineDataContext newsDB1) =>
                        (from News p in newsDB1.StoredNewsList
                         where p.CId == cid
                         select p).Count());

int storedCurCount = getNewsCount(newsDB);

posted @ 2011-09-18 16:27  jeekun  阅读(175)  评论(0编辑  收藏  举报