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))); }
public static Result Check(Money value) { return(Result.Create(0 <= value.Amount, Error.Build())); }
public static Result Check(Guid value, string property) { return(Result.Create(value != Guid.Empty, Error.Build(property).SetPropertyName(property))); }
public static Result Check(string value, string property) { return(Result.Create(!string.IsNullOrWhiteSpace(value), Error.Build(property).SetPropertyName(property))); }
public static Error BuildNotFound(string entity, object identifier) => NotFound.Build(entity, identifier);
public static Error BuildInvalidIdentifier(object identifier) => InvalidIdentifier.Build(identifier);
public static Error BuildAggregateNotFound(string entity, object identifier) => AggregateNotFound.Build(entity, identifier);