forked from dotnetcore/AspectCore-Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataState.cs
More file actions
27 lines (23 loc) · 688 Bytes
/
Copy pathDataState.cs
File metadata and controls
27 lines (23 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using System.Collections.Generic;
using System.Text;
namespace AspectCore.Extensions.DataValidation
{
internal class DataState : IDataState
{
private readonly bool _isDataValid;
public bool IsValid
{
get
{
return _isDataValid && Errors.Count == 0;
}
}
public DataValidationErrorCollection Errors { get; }
public DataState(bool isValid, DataValidationErrorCollection dataValidationErrors)
{
_isDataValid = isValid;
Errors = dataValidationErrors ?? throw new ArgumentNullException(nameof(dataValidationErrors));
}
}
}