コード例 #1
0
            public static Result Check(string value, int maxLength, string property)
            {
                var valueLength = value?.Length ?? 0;

                return(Result.Create(valueLength <= maxLength,
                                     Error.Build(maxLength, property).SetPropertyName(property)));
            }
コード例 #2
0
 public static Result Check(Money value)
 {
     return(Result.Create(0 <= value.Amount, Error.Build()));
 }
コード例 #3
0
 public static Result Check(Guid value, string property)
 {
     return(Result.Create(value != Guid.Empty,
                          Error.Build(property).SetPropertyName(property)));
 }
コード例 #4
0
 public static Result Check(string value, string property)
 {
     return(Result.Create(!string.IsNullOrWhiteSpace(value),
                          Error.Build(property).SetPropertyName(property)));
 }
コード例 #5
0
 public static Error BuildNotFound(string entity, object identifier) => NotFound.Build(entity, identifier);
コード例 #6
0
 public static Error BuildInvalidIdentifier(object identifier) => InvalidIdentifier.Build(identifier);
コード例 #7
0
 public static Error BuildAggregateNotFound(string entity, object identifier) => AggregateNotFound.Build(entity, identifier);