Ejemplo n.º 1
0
 public static DnsResult Merge(this DnsResult a, DnsResult b)
 {
     return(a == null ?
            b == null ? DnsResult.Success : b :
            new DnsResult
     {
         ErrorMessages =
             a.ErrorMessages == null ? b.ErrorMessages :
             b.ErrorMessages == null ? a.ErrorMessages :
             a.ErrorMessages.Concat(b.ErrorMessages)
     });
 }
Ejemplo n.º 2
0
 public static DnsResult Lift(this MaybeNotNull <DnsResult> maybe, DnsResult nullResult = null)
 {
     return(maybe.Kind == MaybeKind.Error ? DnsResult.FromException(maybe.Exception) : (maybe.ValueOrNull() ?? nullResult ?? DnsResult.Failed("Unknown error has occurred")));
 }