Beispiel #1
0
 internal static IReadOnlyCollection <TEnum> GetValues <TEnum>(
     this RequiredMember <TEnum> instance,
     MissingMemberBehavior missingMemberBehavior
     ) where TEnum : struct, Enum =>
 instance.SelectMany(
     value => missingMemberBehavior == MissingMemberBehavior.Error
             ? Parse <TEnum>(value.GetStringRequired())
     : TryHardParse <TEnum>(value.GetStringRequired())
     );
Beispiel #2
0
 internal static DateTimeOffset GetValue(this RequiredMember <DateTimeOffset> instance) =>
 instance.Select(json => json.GetDateTimeOffset());
Beispiel #3
0
 internal static int GetValue(this RequiredMember <Coin> instance) =>
 instance.Select(json => new Coin(json.GetInt32()));
Beispiel #4
0
 internal static bool GetValue(this RequiredMember <bool> instance) =>
 instance.Select(json => json.GetBoolean());
Beispiel #5
0
 internal static string GetValue(this RequiredMember <string> instance) =>
 instance.Select(json => json.GetStringRequired());
Beispiel #6
0
 internal static double GetValue(this RequiredMember <double> instance) =>
 instance.Select(json => json.GetDouble());
Beispiel #7
0
 internal static long GetValue(this RequiredMember <long> instance) =>
 instance.Select(json => json.GetInt64());
Beispiel #8
0
 internal static int GetValue(this RequiredMember <int> instance) =>
 instance.Select(json => json.GetInt32());