First actual commit
added sources to repository
This commit is contained in:
15
RedditSharp/Extensions.cs
Normal file
15
RedditSharp/Extensions.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user