@@ -199,23 +199,20 @@ public static ICollection<T> ParseGenericList(string value, Type createListType,
199
199
public static class DeserializeList < T , TSerializer >
200
200
where TSerializer : ITypeSerializer
201
201
{
202
- private readonly static ParseStringDelegate CacheFn ;
202
+ private static readonly ParseStringDelegate CacheFn ;
203
203
204
204
static DeserializeList ( )
205
205
{
206
206
CacheFn = GetParseFn ( ) ;
207
207
}
208
208
209
- public static ParseStringDelegate Parse
210
- {
211
- get { return CacheFn ; }
212
- }
209
+ public static ParseStringDelegate Parse => CacheFn ;
213
210
214
211
public static ParseStringDelegate GetParseFn ( )
215
212
{
216
213
var listInterface = typeof ( T ) . GetTypeWithGenericInterfaceOf ( typeof ( IList < > ) ) ;
217
214
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<>") ;
219
216
220
217
//optimized access for regularly used types
221
218
if ( typeof ( T ) == typeof ( List < string > ) )
@@ -244,23 +241,20 @@ public static ParseStringDelegate GetParseFn()
244
241
internal static class DeserializeEnumerable < T , TSerializer >
245
242
where TSerializer : ITypeSerializer
246
243
{
247
- private readonly static ParseStringDelegate CacheFn ;
244
+ private static readonly ParseStringDelegate CacheFn ;
248
245
249
246
static DeserializeEnumerable ( )
250
247
{
251
248
CacheFn = GetParseFn ( ) ;
252
249
}
253
250
254
- public static ParseStringDelegate Parse
255
- {
256
- get { return CacheFn ; }
257
- }
251
+ public static ParseStringDelegate Parse => CacheFn ;
258
252
259
253
public static ParseStringDelegate GetParseFn ( )
260
254
{
261
255
var enumerableInterface = typeof ( T ) . GetTypeWithGenericInterfaceOf ( typeof ( IEnumerable < > ) ) ;
262
256
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<>") ;
264
258
265
259
//optimized access for regularly used types
266
260
if ( typeof ( T ) == typeof ( IEnumerable < string > ) )
0 commit comments