diff --git a/src/Microsoft.OData.Client/ALinq/UriWriter.cs b/src/Microsoft.OData.Client/ALinq/UriWriter.cs index 46e4a0f8d9..e933cffc42 100644 --- a/src/Microsoft.OData.Client/ALinq/UriWriter.cs +++ b/src/Microsoft.OData.Client/ALinq/UriWriter.cs @@ -354,7 +354,7 @@ internal void VisitOperationInvocation(QueryableResourceExpression rse) int count = 1; while (this.alias.ContainsKey(aliasName)) { - aliasName = UriHelper.ATSIGN + param.Key + count; + aliasName = UriHelper.ATSIGN + param.Key + count.ToString(CultureInfo.InvariantCulture); count++; } @@ -408,7 +408,7 @@ internal void VisitQueryOptions(ResourceExpression re) this.VisitQueryOptionExpression((FilterQueryOptionExpression)e); break; default: - Debug.Assert(false, "Unexpected expression type " + (int)et); + Debug.Assert(false, "Unexpected expression type " + ((int)et).ToString(CultureInfo.InvariantCulture)); break; } } diff --git a/src/Microsoft.OData.Client/ProjectionPlanCompiler.cs b/src/Microsoft.OData.Client/ProjectionPlanCompiler.cs index 065e95bd72..2c3bdc3c29 100644 --- a/src/Microsoft.OData.Client/ProjectionPlanCompiler.cs +++ b/src/Microsoft.OData.Client/ProjectionPlanCompiler.cs @@ -7,6 +7,8 @@ //// Uncomment the following line to trace projection building activity. ////#define TRACE_CLIENT_PROJECTIONS +using System.Globalization; + namespace Microsoft.OData.Client { #region Namespaces @@ -401,8 +403,8 @@ internal override Expression VisitLambda(LambdaExpression lambda) { this.topLevelProjectionFound = true; - ParameterExpression expectedTypeParameter = Expression.Parameter(typeof(Type), "type" + this.identifierId); - ParameterExpression entryParameter = Expression.Parameter(typeof(object), "entry" + this.identifierId); + ParameterExpression expectedTypeParameter = Expression.Parameter(typeof(Type), "type" + this.identifierId.ToString(CultureInfo.InvariantCulture)); + ParameterExpression entryParameter = Expression.Parameter(typeof(object), "entry" + this.identifierId.ToString(CultureInfo.InvariantCulture)); this.identifierId++; this.pathBuilder.EnterLambdaScope(lambda, entryParameter, expectedTypeParameter); @@ -628,7 +630,7 @@ private Expression RebindEntityMemberInit(MemberInitExpression init) { entryToInitValue = this.GetDeepestEntry(expressions); expectedParamValue = projectedTypeExpression; - entryParameterForMembers = Expression.Parameter(typeof(object), "subentry" + this.identifierId++); + entryParameterForMembers = Expression.Parameter(typeof(object), "subentry" + this.identifierId++.ToString(CultureInfo.InvariantCulture)); expectedParameterForMembers = (ParameterExpression)this.pathBuilder.ExpectedParamTypeInScope; // Annotate the entry expression with 'how we get to it' information. @@ -668,7 +670,7 @@ private Expression RebindEntityMemberInit(MemberInitExpression init) Expression.Constant(assignment.Member.Name, typeof(string))); ParameterExpression nestedEntryParameter = Expression.Parameter( typeof(object), - "subentry" + this.identifierId++); + "subentry" + this.identifierId++.ToString(CultureInfo.InvariantCulture)); // Register the rewrite from the top to the entry if necessary. ProjectionPath entryPath; diff --git a/src/Microsoft.OData.Core/ODataBatchReaderStreamBuffer.cs b/src/Microsoft.OData.Core/ODataBatchReaderStreamBuffer.cs index fe31d8a435..d3980ad415 100644 --- a/src/Microsoft.OData.Core/ODataBatchReaderStreamBuffer.cs +++ b/src/Microsoft.OData.Core/ODataBatchReaderStreamBuffer.cs @@ -4,6 +4,8 @@ // //--------------------------------------------------------------------- +using System.Globalization; + namespace Microsoft.OData { #region Namespaces @@ -585,7 +587,7 @@ private bool MatchBoundary(string boundary, int startIx, int matchLength, out bo currentIx++; } - Debug.Assert(trailingDashes <= TwoDashesLength, "Should never look for more than " + TwoDashesLength + " trailing dashes."); + Debug.Assert(trailingDashes <= TwoDashesLength, "Should never look for more than " + TwoDashesLength.ToString(CultureInfo.InvariantCulture) + " trailing dashes."); isEndBoundary = trailingDashes == TwoDashesLength; return true; } diff --git a/src/Microsoft.OData.Edm/Validation/ValidationRules.cs b/src/Microsoft.OData.Edm/Validation/ValidationRules.cs index 1eea17c13e..aa21ae47c9 100644 --- a/src/Microsoft.OData.Edm/Validation/ValidationRules.cs +++ b/src/Microsoft.OData.Edm/Validation/ValidationRules.cs @@ -239,7 +239,7 @@ public static class ValidationRules } // OperationImports of the same name can exist as long as they reference different operations. - string operationImportUniqueString = operationImport.Name + "_" + operationImport.Operation.GetHashCode(); + string operationImportUniqueString = operationImport.Name + "_" + operationImport.Operation.GetHashCode().ToString(CultureInfo.InvariantCulture); if (operationImportOperationList.Contains(operationImportUniqueString)) { duplicate = true; diff --git a/src/Microsoft.Spatial/CoordinateSystem.cs b/src/Microsoft.Spatial/CoordinateSystem.cs index a40b9ea2ce..ba4f5e4838 100644 --- a/src/Microsoft.Spatial/CoordinateSystem.cs +++ b/src/Microsoft.Spatial/CoordinateSystem.cs @@ -190,7 +190,7 @@ private static CoordinateSystem GetOrCreate(int epsgId, Topology topology) return r; } - r = new CoordinateSystem(epsgId, "ID " + epsgId, topology); + r = new CoordinateSystem(epsgId, "ID " + epsgId.ToString(CultureInfo.InvariantCulture), topology); AddRef(r); } diff --git a/src/Microsoft.Spatial/LexerToken.cs b/src/Microsoft.Spatial/LexerToken.cs index c4e186ca1e..4140dc639e 100644 --- a/src/Microsoft.Spatial/LexerToken.cs +++ b/src/Microsoft.Spatial/LexerToken.cs @@ -4,6 +4,8 @@ // //--------------------------------------------------------------------- +using System.Globalization; + namespace Microsoft.Spatial { using System; @@ -41,7 +43,7 @@ public bool MatchToken(int targetType, String targetText, StringComparison compa /// String representation of this token public override string ToString() { - return "Type:[" + this.Type + "] Text:[" + this.Text + "]"; + return "Type:[" + this.Type.ToString(CultureInfo.InvariantCulture) + "] Text:[" + this.Text + "]"; } } }