예제 #1
0
        public override Task <ICommandResult> Persist()
        {
            var sampleValidationResult = new SampleValidationResult();

            sampleValidationResult.Add(new ValidationResult(errorMessage: "Another Test Error Message"));

            return(Task.FromResult((ICommandResult)sampleValidationResult));
        }
        public async Task <IValidationResult> Validate(InsertVendor command)
        {
            var sampleValidationResult = new SampleValidationResult();

            if (command.Criteria?.Address != null)
            {
                if (command.Criteria.Address.Line1 == "111 Street")
                {
                    sampleValidationResult.Add(new ValidationResult(errorMessage: "Street Cannot Be 111 Street", memberNames: new[] { nameof(command.Criteria.Address.Line1) }));
                }
            }

            return(await Task.FromResult(sampleValidationResult));
        }