Added Shared project, resync'd net45 projects with dnx ones

This commit is contained in:
RogueException
2015-12-06 02:00:21 -04:00
parent 1f3796ff96
commit 0828d8eb40
17 changed files with 84 additions and 56 deletions

View File

@@ -0,0 +1,20 @@
using System;
using System.Globalization;
namespace Discord
{
internal static class IdConvert
{
internal static readonly IFormatProvider _format = CultureInfo.InvariantCulture;
public static long ToLong(string value)
=> long.Parse(value, NumberStyles.None, _format);
public static long? ToNullableLong(string value)
=> value == null ? (long?)null : long.Parse(value, NumberStyles.None, _format);
public static string ToString(long value)
=> value.ToString(_format);
public static string ToString(long? value)
=> value?.ToString(_format);
}
}