public static SettingsBindingResult <TTarget> Convert <TSource, TTarget>(this SettingsBindingResult <TSource> result)
     where TSource : TTarget =>
 result.Errors.Any() ? SettingsBindingResult.Errors <TTarget>(result.Errors) : SettingsBindingResult.Success <TTarget>(result.Value);
 public static SettingsBindingResult <TSource?> ConvertToNullable <TSource>(this SettingsBindingResult <TSource> result)
     where TSource : struct =>
 result.Errors.Any() ? SettingsBindingResult.Errors <TSource?>(result.Errors) : SettingsBindingResult.Success <TSource?>(result.Value);
Example #3
0
 public static SettingsBindingResult <TTarget> Convert <TSource, TTarget>(this SettingsBindingResult <TSource> result, Func <TSource, TTarget> converter) =>
 result.Errors.Any() ? SettingsBindingResult.Errors <TTarget>(result.Errors) : SettingsBindingResult.Success <TTarget>(converter(result.Value));