@@ -199,23 +199,20 @@ public static ICollection<T> ParseGenericList(string value, Type createListType,
199199 public static class DeserializeList < T , TSerializer >
200200 where TSerializer : ITypeSerializer
201201 {
202- private readonly static ParseStringDelegate CacheFn ;
202+ private static readonly ParseStringDelegate CacheFn ;
203203
204204 static DeserializeList ( )
205205 {
206206 CacheFn = GetParseFn ( ) ;
207207 }
208208
209- public static ParseStringDelegate Parse
210- {
211- get { return CacheFn ; }
212- }
209+ public static ParseStringDelegate Parse => CacheFn ;
213210
214211 public static ParseStringDelegate GetParseFn ( )
215212 {
216213 var listInterface = typeof ( T ) . GetTypeWithGenericInterfaceOf ( typeof ( IList < > ) ) ;
217214 if ( listInterface == null )
218- throw new ArgumentException ( string . Format ( "Type {0 } is not of type IList<>" , typeof ( T ) . FullName ) ) ;
215+ throw new ArgumentException ( $ "Type { typeof ( T ) . FullName } is not of type IList<>") ;
219216
220217 //optimized access for regularly used types
221218 if ( typeof ( T ) == typeof ( List < string > ) )
@@ -244,23 +241,20 @@ public static ParseStringDelegate GetParseFn()
244241 internal static class DeserializeEnumerable < T , TSerializer >
245242 where TSerializer : ITypeSerializer
246243 {
247- private readonly static ParseStringDelegate CacheFn ;
244+ private static readonly ParseStringDelegate CacheFn ;
248245
249246 static DeserializeEnumerable ( )
250247 {
251248 CacheFn = GetParseFn ( ) ;
252249 }
253250
254- public static ParseStringDelegate Parse
255- {
256- get { return CacheFn ; }
257- }
251+ public static ParseStringDelegate Parse => CacheFn ;
258252
259253 public static ParseStringDelegate GetParseFn ( )
260254 {
261255 var enumerableInterface = typeof ( T ) . GetTypeWithGenericInterfaceOf ( typeof ( IEnumerable < > ) ) ;
262256 if ( enumerableInterface == null )
263- throw new ArgumentException ( string . Format ( "Type {0 } is not of type IEnumerable<>" , typeof ( T ) . FullName ) ) ;
257+ throw new ArgumentException ( $ "Type { typeof ( T ) . FullName } is not of type IEnumerable<>") ;
264258
265259 //optimized access for regularly used types
266260 if ( typeof ( T ) == typeof ( IEnumerable < string > ) )
0 commit comments