@@ -27,8 +27,7 @@ public CompoundKeyQueryManager(ICompoundKeyCachingStrategy<T> cachingStrategy)
2727
2828 public TResult ExecuteGet < TResult > ( Func < TResult > query , Expression < Func < T , TResult > > selector , object [ ] keys )
2929 {
30- TResult result ;
31- if ( _cachingStrategy . TryGetResult ( keys , selector , out result ) )
30+ if ( _cachingStrategy . TryGetResult ( keys , selector , out TResult result ) )
3231 {
3332 CacheUsed = true ;
3433 return result ;
@@ -44,8 +43,7 @@ public TResult ExecuteGet<TResult>(Func<TResult> query, Expression<Func<T, TResu
4443
4544 public IEnumerable < TResult > ExecuteGetAll < TResult > ( Func < IEnumerable < TResult > > query , Expression < Func < T , TResult > > selector , IQueryOptions < T > queryOptions )
4645 {
47- IEnumerable < TResult > result ;
48- if ( _cachingStrategy . TryGetAllResult ( queryOptions , selector , out result ) )
46+ if ( _cachingStrategy . TryGetAllResult ( queryOptions , selector , out IEnumerable < TResult > result ) )
4947 {
5048 CacheUsed = true ;
5149 return result ;
@@ -61,8 +59,7 @@ public IEnumerable<TResult> ExecuteGetAll<TResult>(Func<IEnumerable<TResult>> qu
6159
6260 public IEnumerable < TResult > ExecuteFindAll < TResult > ( Func < IEnumerable < TResult > > query , ISpecification < T > criteria , Expression < Func < T , TResult > > selector , IQueryOptions < T > queryOptions )
6361 {
64- IEnumerable < TResult > result ;
65- if ( _cachingStrategy . TryFindAllResult ( criteria , queryOptions , selector , out result ) )
62+ if ( _cachingStrategy . TryFindAllResult ( criteria , queryOptions , selector , out IEnumerable < TResult > result ) )
6663 {
6764 CacheUsed = true ;
6865 return result ;
@@ -78,8 +75,7 @@ public IEnumerable<TResult> ExecuteFindAll<TResult>(Func<IEnumerable<TResult>> q
7875
7976 public TResult ExecuteFind < TResult > ( Func < TResult > query , ISpecification < T > criteria , Expression < Func < T , TResult > > selector , IQueryOptions < T > queryOptions )
8077 {
81- TResult result ;
82- if ( _cachingStrategy . TryFindResult ( criteria , queryOptions , selector , out result ) )
78+ if ( _cachingStrategy . TryFindResult ( criteria , queryOptions , selector , out TResult result ) )
8379 {
8480 CacheUsed = true ;
8581 return result ;
@@ -136,8 +132,7 @@ public CompoundKeyQueryManager(ICompoundKeyCachingStrategy<T, TKey, TKey2> cachi
136132
137133 public TResult ExecuteGet < TResult > ( Func < TResult > query , Expression < Func < T , TResult > > selector , TKey key , TKey2 key2 )
138134 {
139- TResult result ;
140- if ( _cachingStrategy . TryGetResult ( key , key2 , selector , out result ) )
135+ if ( _cachingStrategy . TryGetResult ( key , key2 , selector , out TResult result ) )
141136 {
142137 CacheUsed = true ;
143138 return result ;
@@ -153,8 +148,7 @@ public TResult ExecuteGet<TResult>(Func<TResult> query, Expression<Func<T, TResu
153148
154149 public IEnumerable < TResult > ExecuteGetAll < TResult > ( Func < IEnumerable < TResult > > query , Expression < Func < T , TResult > > selector , IQueryOptions < T > queryOptions )
155150 {
156- IEnumerable < TResult > result ;
157- if ( _cachingStrategy . TryGetAllResult ( queryOptions , selector , out result ) )
151+ if ( _cachingStrategy . TryGetAllResult ( queryOptions , selector , out IEnumerable < TResult > result ) )
158152 {
159153 CacheUsed = true ;
160154 return result ;
@@ -170,8 +164,7 @@ public IEnumerable<TResult> ExecuteGetAll<TResult>(Func<IEnumerable<TResult>> qu
170164
171165 public IEnumerable < TResult > ExecuteFindAll < TResult > ( Func < IEnumerable < TResult > > query , ISpecification < T > criteria , Expression < Func < T , TResult > > selector , IQueryOptions < T > queryOptions )
172166 {
173- IEnumerable < TResult > result ;
174- if ( _cachingStrategy . TryFindAllResult ( criteria , queryOptions , selector , out result ) )
167+ if ( _cachingStrategy . TryFindAllResult ( criteria , queryOptions , selector , out IEnumerable < TResult > result ) )
175168 {
176169 CacheUsed = true ;
177170 return result ;
@@ -187,8 +180,7 @@ public IEnumerable<TResult> ExecuteFindAll<TResult>(Func<IEnumerable<TResult>> q
187180
188181 public TResult ExecuteFind < TResult > ( Func < TResult > query , ISpecification < T > criteria , Expression < Func < T , TResult > > selector , IQueryOptions < T > queryOptions )
189182 {
190- TResult result ;
191- if ( _cachingStrategy . TryFindResult ( criteria , queryOptions , selector , out result ) )
183+ if ( _cachingStrategy . TryFindResult ( criteria , queryOptions , selector , out TResult result ) )
192184 {
193185 CacheUsed = true ;
194186 return result ;
@@ -246,8 +238,7 @@ public CompoundKeyQueryManager(ICompoundKeyCachingStrategy<T, TKey, TKey2, TKey3
246238
247239 public TResult ExecuteGet < TResult > ( Func < TResult > query , Expression < Func < T , TResult > > selector , TKey key , TKey2 key2 , TKey3 key3 )
248240 {
249- TResult result ;
250- if ( _cachingStrategy . TryGetResult ( key , key2 , key3 , selector , out result ) )
241+ if ( _cachingStrategy . TryGetResult ( key , key2 , key3 , selector , out TResult result ) )
251242 {
252243 CacheUsed = true ;
253244 return result ;
@@ -263,8 +254,7 @@ public TResult ExecuteGet<TResult>(Func<TResult> query, Expression<Func<T, TResu
263254
264255 public IEnumerable < TResult > ExecuteGetAll < TResult > ( Func < IEnumerable < TResult > > query , Expression < Func < T , TResult > > selector , IQueryOptions < T > queryOptions )
265256 {
266- IEnumerable < TResult > result ;
267- if ( _cachingStrategy . TryGetAllResult ( queryOptions , selector , out result ) )
257+ if ( _cachingStrategy . TryGetAllResult ( queryOptions , selector , out IEnumerable < TResult > result ) )
268258 {
269259 CacheUsed = true ;
270260 return result ;
@@ -280,8 +270,7 @@ public IEnumerable<TResult> ExecuteGetAll<TResult>(Func<IEnumerable<TResult>> qu
280270
281271 public IEnumerable < TResult > ExecuteFindAll < TResult > ( Func < IEnumerable < TResult > > query , ISpecification < T > criteria , Expression < Func < T , TResult > > selector , IQueryOptions < T > queryOptions )
282272 {
283- IEnumerable < TResult > result ;
284- if ( _cachingStrategy . TryFindAllResult ( criteria , queryOptions , selector , out result ) )
273+ if ( _cachingStrategy . TryFindAllResult ( criteria , queryOptions , selector , out IEnumerable < TResult > result ) )
285274 {
286275 CacheUsed = true ;
287276 return result ;
@@ -297,8 +286,7 @@ public IEnumerable<TResult> ExecuteFindAll<TResult>(Func<IEnumerable<TResult>> q
297286
298287 public TResult ExecuteFind < TResult > ( Func < TResult > query , ISpecification < T > criteria , Expression < Func < T , TResult > > selector , IQueryOptions < T > queryOptions )
299288 {
300- TResult result ;
301- if ( _cachingStrategy . TryFindResult ( criteria , queryOptions , selector , out result ) )
289+ if ( _cachingStrategy . TryFindResult ( criteria , queryOptions , selector , out TResult result ) )
302290 {
303291 CacheUsed = true ;
304292 return result ;
0 commit comments