16 lines
351 B
C#
16 lines
351 B
C#
using Newtonsoft.Json.Linq;
|
|
using System.Collections.Generic;
|
|
|
|
namespace RedditSharp
|
|
{
|
|
public static class Extensions
|
|
{
|
|
public static T ValueOrDefault<T>(this IEnumerable<JToken> enumerable)
|
|
{
|
|
if (enumerable == null)
|
|
return default(T);
|
|
return enumerable.Value<T>();
|
|
}
|
|
}
|
|
}
|