Skip to content

Instantly share code, notes, and snippets.

@ncruces
Last active November 27, 2019 17:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ncruces/be5a008f4ea49b22c6de479b52e61b4f to your computer and use it in GitHub Desktop.
Save ncruces/be5a008f4ea49b22c6de479b52e61b4f to your computer and use it in GitHub Desktop.
Culture invariant IUrlParameterFormatter for https://github.com/reactiveui
using System;
using System.Globalization;
using System.Reflection;
namespace Refit
{
public sealed class InvariantUrlParameterFormatter : IUrlParameterFormatter
{
public string Format(object parameterValue, ParameterInfo parameterInfo)
{
if (parameterValue == null) return null;
return Convert.ToString(parameterValue, CultureInfo.InvariantCulture);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment