Skip to content

Commit

Permalink
cleanup: validation - removed Success
Browse files Browse the repository at this point in the history
  • Loading branch information
cime committed Mar 1, 2021
1 parent f1f490e commit fb4aff4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CoreSharp.Validation.Tests/Models/AsyncParent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ public override Task BeforeValidationAsync(TModel root, ValidationContext contex
return Task.CompletedTask;
}

public override async IAsyncEnumerable<ValidationFailure> ValidateAsync(TChild child, ValidationContext context)
public override IAsyncEnumerable<ValidationFailure> ValidateAsync(TChild child, ValidationContext context)
{
ValidateModels.Add(new Tuple<TChild, IAsyncDomainValidator>(child, this));

yield break;
return null;
}

public override Task<bool> CanValidateAsync(TChild child, ValidationContext context)
Expand Down
5 changes: 3 additions & 2 deletions CoreSharp.Validation.Tests/Models/TestModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ public override Task BeforeValidationAsync(TestModel root, ValidationContext con
return Task.CompletedTask;
}

public override async IAsyncEnumerable<ValidationFailure> ValidateAsync(TestModel child, ValidationContext context)
public override IAsyncEnumerable<ValidationFailure> ValidateAsync(TestModel child, ValidationContext context)
{
ValidateCount++;
yield break;

return null;
}

public override Task<bool> CanValidateAsync(TestModel child, ValidationContext context)
Expand Down
2 changes: 0 additions & 2 deletions CoreSharp.Validation/AbstractAsyncDomainValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,5 @@ protected ValidationFailure Failure(string errorMessage, ValidationContext conte
{
return DomainValidationContext.CreateValidationFailure(errorMessage, context);
}

protected ValidationFailure Success => null;
}
}

0 comments on commit fb4aff4

Please sign in to comment.