示例#1
0
 internal static TEnum?GetValue <TEnum>(
     this NullableMember <TEnum> instance,
     MissingMemberBehavior missingMemberBehavior
     ) where TEnum : struct, Enum =>
 instance.Select(
     value => missingMemberBehavior == MissingMemberBehavior.Error
             ? Parse <TEnum>(value.GetStringRequired())
     : TryHardParse <TEnum>(value.GetStringRequired())
     );
示例#2
0
 internal static bool?GetValue(this NullableMember <bool> instance) =>
 instance.Select(json => json.GetBoolean());
示例#3
0
 internal static int?GetValue(this NullableMember <int> instance) =>
 instance.Select(json => json.GetInt32());