@@ -2,6 +2,7 @@ namespace Belin.Sql;
22
33using System . Collections ;
44using System . Collections . Specialized ;
5+ using System . Globalization ;
56
67/// <summary>
78/// A collection of hints describing the sort order of columns.
@@ -24,7 +25,7 @@ public class SqlOrderHintCollection(params IEnumerable<SqlOrderHint> orderHints)
2425 /// <param name="columns">The array whose elements are copied to the order hint collection.</param>
2526 /// <returns>The order hint collection corresponding to the specified array of column names.</returns>
2627 public static implicit operator SqlOrderHintCollection ( object ? [ ] columns ) =>
27- [ .. columns . Select ( value => new SqlOrderHint ( value ? . ToString ( ) ?? "" , SortOrder . Ascending ) ) ] ;
28+ [ .. columns . Select ( value => new SqlOrderHint ( Convert . ToString ( value , CultureInfo . InvariantCulture ) ?? "" , SortOrder . Ascending ) ) ] ;
2829
2930 /// <summary>
3031 /// Creates a new order hint collection from the specified array of column names.
@@ -48,8 +49,8 @@ public static implicit operator SqlOrderHintCollection(List<string> columns) =>
4849 /// <param name="orderHints">The dictionary whose elements are copied to the order hint collection.</param>
4950 /// <returns>The order hint collection corresponding to the specified dictionary of column names and sort orders.</returns>
5051 public static implicit operator SqlOrderHintCollection ( OrderedDictionary orderHints ) => [ .. orderHints . Cast < DictionaryEntry > ( ) . Select ( entry => {
51- var value = entry . Value is SortOrder sortOrder ? sortOrder : Enum . Parse < SortOrder > ( entry . Value ? . ToString ( ) ?? "" , ignoreCase : true ) ;
52- return new SqlOrderHint ( entry . Key . ToString ( ) ?? "" , value ) ;
52+ var value = entry . Value is SortOrder sortOrder ? sortOrder : Enum . Parse < SortOrder > ( Convert . ToString ( entry . Value , CultureInfo . InvariantCulture ) ?? "" , ignoreCase : true ) ;
53+ return new SqlOrderHint ( Convert . ToString ( entry . Key , CultureInfo . InvariantCulture ) ?? "" , value ) ;
5354 } ) ] ;
5455
5556 /// <summary>
0 commit comments