File tree Expand file tree Collapse file tree
ObjectSemantics.NET/Engine Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,8 +31,6 @@ private static string GetAppliedPropertyFormatting(this ExtractedObjProperty p,
3131
3232 // avoid repeated ToLower calls
3333 string fmt = customFormat . Trim ( ) ;
34- string fmtLower = fmt . ToLowerInvariant ( ) ;
35-
3634 // handle numeric and datetime formats first
3735 try
3836 {
@@ -55,7 +53,7 @@ private static string GetAppliedPropertyFormatting(this ExtractedObjProperty p,
5553 }
5654
5755 // custom string-based formats (single switch to avoid multiple ToLower() checks)
58- switch ( fmtLower )
56+ switch ( fmt . ToLowerInvariant ( ) )
5957 {
6058 case "uppercase" : return val ? . ToUpperInvariant ( ) ;
6159 case "lowercase" : return val ? . ToLowerInvariant ( ) ;
@@ -102,8 +100,7 @@ public static bool IsPropertyValueConditionPassed(this ExtractedObjProperty prop
102100 }
103101 }
104102
105- if ( t == typeof ( int ) || t == typeof ( double ) || t == typeof ( long ) ||
106- t == typeof ( float ) || t == typeof ( decimal ) )
103+ if ( t == typeof ( int ) || t == typeof ( double ) || t == typeof ( long ) || t == typeof ( float ) || t == typeof ( decimal ) )
107104 {
108105 double v1 = Convert . ToDouble ( original ?? 0 , CultureInfo . InvariantCulture ) ;
109106 double v2 = Convert . ToDouble ( GetConvertibleValue < double > ( valueComparer ) , CultureInfo . InvariantCulture ) ;
Original file line number Diff line number Diff line change 11using System ;
2+ using System . Globalization ;
23using System . Text ;
34
45namespace ObjectSemantics . NET . Engine . Extensions
@@ -36,7 +37,7 @@ public static string ToMD5String(this string input)
3637 // Convert the byte array to hexadecimal string
3738 StringBuilder sb = new StringBuilder ( ) ;
3839 for ( int i = 0 ; i < hashBytes . Length ; i ++ )
39- sb . Append ( hashBytes [ i ] . ToString ( "X2" ) ) ;
40+ sb . Append ( hashBytes [ i ] . ToString ( "X2" , CultureInfo . InvariantCulture ) ) ;
4041 return sb . ToString ( ) ;
4142 }
4243 }
Original file line number Diff line number Diff line change 11using System ;
22using System . Collections ;
3+ using System . Globalization ;
34
45namespace ObjectSemantics . NET . Engine . Models
56{
@@ -8,7 +9,8 @@ internal class ExtractedObjProperty
89 public Type Type { get ; set ; }
910 public string Name { get ; set ; }
1011 public object OriginalValue { get ; set ; }
11- public string StringFormatted { get { return string . Format ( "{0}" , OriginalValue ) ; } }
12+ public string StringFormatted => Convert . ToString ( OriginalValue , CultureInfo . InvariantCulture ) ;
13+
1214 public bool IsEnumerableObject
1315 {
1416 get { return typeof ( IEnumerable ) . IsAssignableFrom ( Type ) && Type != typeof ( string ) ; }
You can’t perform that action at this time.
0 commit comments