@@ -32,14 +32,8 @@ public class OrmLiteContext
3232 /// </summary>
3333 public virtual IDictionary Items
3434 {
35- get
36- {
37- return GetItems ( ) ?? ( CreateItems ( ) ) ;
38- }
39- set
40- {
41- CreateItems ( value ) ;
42- }
35+ get => GetItems ( ) ?? ( CreateItems ( ) ) ;
36+ set => CreateItems ( value ) ;
4337 }
4438
4539 private const string _key = "__OrmLite.Items" ;
@@ -83,17 +77,17 @@ private IDictionary CreateItems(IDictionary items = null)
8377 {
8478 if ( UseThreadStatic )
8579 {
86- ContextItems = items ?? ( items = new Dictionary < object , object > ( ) ) ;
80+ ContextItems = items ??= new Dictionary < object , object > ( ) ;
8781 }
8882 else
8983 {
90- CallContext . LogicalSetData ( _key , items ?? ( items = new ConcurrentDictionary < object , object > ( ) ) ) ;
84+ CallContext . LogicalSetData ( _key , items ??= new ConcurrentDictionary < object , object > ( ) ) ;
9185 }
9286 }
9387 catch ( NotImplementedException )
9488 {
9589 //Fixed in Mono master: https://github.com/mono/mono/pull/817
96- CallContext . SetData ( _key , items ?? ( items = new ConcurrentDictionary < object , object > ( ) ) ) ;
90+ CallContext . SetData ( _key , items ??= new ConcurrentDictionary < object , object > ( ) ) ;
9791 }
9892#endif
9993 return items ;
@@ -157,10 +151,7 @@ public static OrmLiteState OrmLiteState
157151
158152 return null ;
159153 }
160- set
161- {
162- SetItem ( "OrmLiteState" , value ) ;
163- }
154+ set => SetItem ( "OrmLiteState" , value ) ;
164155 }
165156
166157 //Only used when using OrmLite API's against a native IDbConnection (i.e. not from DbFactory)
@@ -171,7 +162,7 @@ internal static IDbTransaction TSTransaction
171162 var state = OrmLiteState ;
172163 return state ? . TSTransaction ;
173164 }
174- set { GetOrCreateState ( ) . TSTransaction = value ; }
165+ set => GetOrCreateState ( ) . TSTransaction = value ;
175166 }
176167 }
177168
0 commit comments