Skip to content

Commit

Permalink
Fix build erros by adding IFormatProvider. (#1556)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdebaere authored and mikepizzo committed Oct 30, 2019
1 parent fb0fb18 commit e08a361
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/Microsoft.OData.Client/ALinq/UriWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}

Expand Down Expand Up @@ -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;
}
}
Expand Down
10 changes: 6 additions & 4 deletions src/Microsoft.OData.Client/ProjectionPlanCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/Microsoft.OData.Core/ODataBatchReaderStreamBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// </copyright>
//---------------------------------------------------------------------

using System.Globalization;

namespace Microsoft.OData
{
#region Namespaces
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.OData.Edm/Validation/ValidationRules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Spatial/CoordinateSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 3 additions & 1 deletion src/Microsoft.Spatial/LexerToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// </copyright>
//---------------------------------------------------------------------

using System.Globalization;

namespace Microsoft.Spatial
{
using System;
Expand Down Expand Up @@ -41,7 +43,7 @@ public bool MatchToken(int targetType, String targetText, StringComparison compa
/// <returns>String representation of this token</returns>
public override string ToString()
{
return "Type:[" + this.Type + "] Text:[" + this.Text + "]";
return "Type:[" + this.Type.ToString(CultureInfo.InvariantCulture) + "] Text:[" + this.Text + "]";
}
}
}

0 comments on commit e08a361

Please sign in to comment.