@@ -18,7 +18,7 @@ public static object Deserialize(this string input, Type type)
1818 return type . GetDefaultValue ( ) ;
1919 }
2020
21- type = Nullable . GetUnderlyingType ( type ) ?? type ;
21+ type = Nullable . GetUnderlyingType ( type ) ?? type ;
2222
2323 if ( type == typeof ( DateTimeOffset ) )
2424 {
@@ -29,12 +29,12 @@ public static object Deserialize(this string input, Type type)
2929 {
3030 return TimeSpan . Parse ( input , CultureInfo . InvariantCulture ) ;
3131 }
32-
32+
3333 if ( type == typeof ( Guid ) )
3434 {
3535 return Guid . Parse ( input ) ;
3636 }
37-
37+
3838 if ( type . IsArray )
3939 {
4040 Type arrType = type . GetElementType ( ) ;
@@ -47,7 +47,7 @@ public static object Deserialize(this string input, Type type)
4747
4848 return arr . ToArray ( ) ;
4949 }
50-
50+
5151 if ( type . IsEnum )
5252 {
5353 return Enum . Parse ( type , input ) ;
@@ -64,7 +64,7 @@ public static string Serialize(this object input)
6464 {
6565 string result = "" ;
6666
67- object [ ] arr = ( object [ ] ) input ;
67+ object [ ] arr = ( object [ ] ) input ;
6868
6969 for ( int i = 0 ; i < arr . Length ; i ++ )
7070 {
@@ -79,19 +79,22 @@ public static string Serialize(this object input)
7979 return result ;
8080 }
8181
82- return input is IFormattable formattable ? formattable . ToString ( null , CultureInfo . InvariantCulture ) : input . ToString ( ) ;
83- }
82+ return input is IFormattable formattable
83+ ? formattable . ToString ( null , CultureInfo . InvariantCulture )
84+ : input . ToString ( ) ;
85+ }
8486
8587 return "" ;
8688 }
8789
88- public static TKey GetKey < TKey , T > ( IPrincipalKeyValueFactory < T > keyValueFactory , IEntityType entityType , Func < string , string > valueSelector )
90+ public static TKey GetKey < TKey , T > ( IPrincipalKeyValueFactory < T > keyValueFactory , IEntityType entityType ,
91+ Func < string , string > valueSelector )
8992 {
90- return ( TKey ) keyValueFactory . CreateFromKeyValues (
93+ return ( TKey ) keyValueFactory . CreateFromKeyValues (
9194 entityType . FindPrimaryKey ( ) . Properties
9295 . Select ( p =>
9396 valueSelector ( p . GetColumnName ( ) )
9497 . Deserialize ( p . GetValueConverter ( ) ? . ProviderClrType ?? p . ClrType ) ) . ToArray ( ) ) ;
9598 }
9699 }
97- }
100+ }
0 commit comments