1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-18 21:35:27 -04:00
Files
Sonarr/src/NzbDrone.Common/Extensions/TryParseExtensions.cs
T
Taloth Saldono 0b219e1169 Fixed nullables.
2015-10-03 21:19:25 +02:00

31 lines
610 B
C#

using System;
namespace NzbDrone.Common.Extensions
{
public static class TryParseExtensions
{
public static int? ParseInt32(this string source)
{
int result = 0;
if (int.TryParse(source, out result))
{
return result;
}
return null;
}
public static Nullable<long> ParseInt64(this string source)
{
long result = 0;
if (long.TryParse(source, out result))
{
return result;
}
return null;
}
}
}