17 lines
374 B
C#
17 lines
374 B
C#
using System.Collections.Generic;
|
|
|
|
namespace Facebook.MiniJSON
|
|
{
|
|
public static class MiniJsonUtil
|
|
{
|
|
public static T ReadValue<T>(this Dictionary<string, object> dic, string key)
|
|
{
|
|
if (dic.TryGetValue(key, out var objValue))
|
|
{
|
|
return (T) objValue;
|
|
}
|
|
|
|
return default(T);
|
|
}
|
|
}
|
|
} |