@@ -191,8 +191,7 @@ public TResult Get<TResult>(Expression<Func<T, TResult>> selector, params object
191191
192192 public bool Exists ( params object [ ] keys )
193193 {
194- T entity ;
195- return TryGet ( out entity , keys ) ;
194+ return TryGet ( out T entity , keys ) ;
196195 }
197196
198197 public bool TryGet ( out T entity , params object [ ] keys )
@@ -292,8 +291,7 @@ public TResult Find<TResult>(ISpecification<T> criteria, Expression<Func<T, TRes
292291
293292 public bool Exists ( ISpecification < T > criteria )
294293 {
295- T entity ;
296- return TryFind ( criteria , out entity ) ;
294+ return TryFind ( criteria , out T entity ) ;
297295 }
298296
299297 public bool TryFind ( ISpecification < T > criteria , out T entity )
@@ -353,8 +351,7 @@ public TResult Find<TResult>(Expression<Func<T, bool>> predicate, Expression<Fun
353351
354352 public bool Exists ( Expression < Func < T , bool > > predicate )
355353 {
356- T entity ;
357- return TryFind ( predicate , out entity ) ;
354+ return TryFind ( predicate , out T entity ) ;
358355 }
359356
360357 public bool TryFind ( Expression < Func < T , bool > > predicate , out T entity )
@@ -415,8 +412,7 @@ private void ProcessAdd(T entity, bool batchMode)
415412
416413 Save ( ) ;
417414
418- object [ ] keys ;
419- if ( GetPrimaryKeys ( entity , out keys ) )
415+ if ( GetPrimaryKeys ( entity , out object [ ] keys ) )
420416 _queryManager . OnItemAdded ( keys , entity ) ;
421417 }
422418
@@ -448,8 +444,7 @@ private void ProcessDelete(T entity, bool batchMode)
448444
449445 Save ( ) ;
450446
451- object [ ] keys ;
452- if ( GetPrimaryKeys ( entity , out keys ) )
447+ if ( GetPrimaryKeys ( entity , out object [ ] keys ) )
453448 _queryManager . OnItemDeleted ( keys , entity ) ;
454449 }
455450
@@ -498,8 +493,7 @@ private void ProcessUpdate(T entity, bool batchMode)
498493
499494 Save ( ) ;
500495
501- object [ ] keys ;
502- if ( GetPrimaryKeys ( entity , out keys ) )
496+ if ( GetPrimaryKeys ( entity , out object [ ] keys ) )
503497 _queryManager . OnItemUpdated ( keys , entity ) ;
504498 }
505499
@@ -777,8 +771,7 @@ public TResult Get<TResult>(TKey key, TKey2 key2, Expression<Func<T, TResult>> s
777771
778772 public bool Exists ( TKey key , TKey2 key2 )
779773 {
780- T entity ;
781- return TryGet ( key , key2 , out entity ) ;
774+ return TryGet ( key , key2 , out T entity ) ;
782775 }
783776
784777 public bool TryGet ( TKey key , TKey2 key2 , out T entity )
@@ -893,8 +886,7 @@ public TResult Find<TResult>(ISpecification<T> criteria, Expression<Func<T, TRes
893886
894887 public bool Exists ( ISpecification < T > criteria )
895888 {
896- T entity ;
897- return TryFind ( criteria , out entity ) ;
889+ return TryFind ( criteria , out T entity ) ;
898890 }
899891
900892 public bool TryFind ( ISpecification < T > criteria , out T entity )
@@ -954,8 +946,7 @@ public TResult Find<TResult>(Expression<Func<T, bool>> predicate, Expression<Fun
954946
955947 public bool Exists ( Expression < Func < T , bool > > predicate )
956948 {
957- T entity ;
958- return TryFind ( predicate , out entity ) ;
949+ return TryFind ( predicate , out T entity ) ;
959950 }
960951
961952 public bool TryFind ( Expression < Func < T , bool > > predicate , out T entity )
@@ -1016,9 +1007,7 @@ private void ProcessAdd(T entity, bool batchMode)
10161007
10171008 Save ( ) ;
10181009
1019- TKey key ;
1020- TKey2 key2 ;
1021- if ( GetPrimaryKey ( entity , out key , out key2 ) )
1010+ if ( GetPrimaryKey ( entity , out TKey key , out TKey2 key2 ) )
10221011 _queryManager . OnItemAdded ( key , key2 , entity ) ;
10231012 }
10241013
@@ -1050,9 +1039,7 @@ private void ProcessDelete(T entity, bool batchMode)
10501039
10511040 Save ( ) ;
10521041
1053- TKey key ;
1054- TKey2 key2 ;
1055- if ( GetPrimaryKey ( entity , out key , out key2 ) )
1042+ if ( GetPrimaryKey ( entity , out TKey key , out TKey2 key2 ) )
10561043 _queryManager . OnItemDeleted ( key , key2 , entity ) ;
10571044 }
10581045
@@ -1101,9 +1088,7 @@ private void ProcessUpdate(T entity, bool batchMode)
11011088
11021089 Save ( ) ;
11031090
1104- TKey key ;
1105- TKey2 key2 ;
1106- if ( GetPrimaryKey ( entity , out key , out key2 ) )
1091+ if ( GetPrimaryKey ( entity , out TKey key , out TKey2 key2 ) )
11071092 _queryManager . OnItemUpdated ( key , key2 , entity ) ;
11081093 }
11091094
@@ -1381,8 +1366,7 @@ public TResult Get<TResult>(TKey key, TKey2 key2, TKey3 key3, Expression<Func<T,
13811366
13821367 public bool Exists ( TKey key , TKey2 key2 , TKey3 key3 )
13831368 {
1384- T entity ;
1385- return TryGet ( key , key2 , key3 , out entity ) ;
1369+ return TryGet ( key , key2 , key3 , out T entity ) ;
13861370 }
13871371
13881372 public bool TryGet ( TKey key , TKey2 key2 , TKey3 key3 , out T entity )
@@ -1497,8 +1481,7 @@ public TResult Find<TResult>(ISpecification<T> criteria, Expression<Func<T, TRes
14971481
14981482 public bool Exists ( ISpecification < T > criteria )
14991483 {
1500- T entity ;
1501- return TryFind ( criteria , out entity ) ;
1484+ return TryFind ( criteria , out T entity ) ;
15021485 }
15031486
15041487 public bool TryFind ( ISpecification < T > criteria , out T entity )
@@ -1558,8 +1541,7 @@ public TResult Find<TResult>(Expression<Func<T, bool>> predicate, Expression<Fun
15581541
15591542 public bool Exists ( Expression < Func < T , bool > > predicate )
15601543 {
1561- T entity ;
1562- return TryFind ( predicate , out entity ) ;
1544+ return TryFind ( predicate , out T entity ) ;
15631545 }
15641546
15651547 public bool TryFind ( Expression < Func < T , bool > > predicate , out T entity )
@@ -1620,10 +1602,7 @@ private void ProcessAdd(T entity, bool batchMode)
16201602
16211603 Save ( ) ;
16221604
1623- TKey key ;
1624- TKey2 key2 ;
1625- TKey3 key3 ;
1626- if ( GetPrimaryKey ( entity , out key , out key2 , out key3 ) )
1605+ if ( GetPrimaryKey ( entity , out TKey key , out TKey2 key2 , out TKey3 key3 ) )
16271606 _queryManager . OnItemAdded ( key , key2 , key3 , entity ) ;
16281607 }
16291608
@@ -1655,10 +1634,7 @@ private void ProcessDelete(T entity, bool batchMode)
16551634
16561635 Save ( ) ;
16571636
1658- TKey key ;
1659- TKey2 key2 ;
1660- TKey3 key3 ;
1661- if ( GetPrimaryKey ( entity , out key , out key2 , out key3 ) )
1637+ if ( GetPrimaryKey ( entity , out TKey key , out TKey2 key2 , out TKey3 key3 ) )
16621638 _queryManager . OnItemDeleted ( key , key2 , key3 , entity ) ;
16631639 }
16641640
@@ -1707,10 +1683,7 @@ private void ProcessUpdate(T entity, bool batchMode)
17071683
17081684 Save ( ) ;
17091685
1710- TKey key ;
1711- TKey2 key2 ;
1712- TKey3 key3 ;
1713- if ( GetPrimaryKey ( entity , out key , out key2 , out key3 ) )
1686+ if ( GetPrimaryKey ( entity , out TKey key , out TKey2 key2 , out TKey3 key3 ) )
17141687 _queryManager . OnItemUpdated ( key , key2 , key3 , entity ) ;
17151688 }
17161689
0 commit comments