Skip to content

Commit

Permalink
Resolve build error
Browse files Browse the repository at this point in the history
  • Loading branch information
inputfalken committed Sep 23, 2018
1 parent f6cde89 commit b8982a4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Lemonad.ErrorHandling/Validator.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Lemonad.ErrorHandling.Extensions;

namespace Lemonad.ErrorHandling {
/// <summary>
Expand All @@ -20,9 +19,12 @@ namespace Lemonad.ErrorHandling {
/// <summary>
/// Convert to a <see cref="Result{T,TError}"/>.
/// </summary>
public Result<T, IReadOnlyCollection<TError>> Result => Count > 0
? _errors.ToResultError<T, IReadOnlyCollection<TError>>()
: _candidate.ToResult<T, IReadOnlyCollection<TError>>();
public Result<T, IReadOnlyCollection<TError>> Result {
get {
var candidate = _candidate;
return _errors.ToResultError<T, IReadOnlyCollection<TError>>(x => x.Count > 0, () => candidate);
}
}

/// <summary>
/// Creates an instance of <see cref="Validator{T,TError}"/>.
Expand Down

0 comments on commit b8982a4

Please sign in to comment.