コード例 #1
0
        public IActionResult CreateAddressModelFV([FromQuery] AddressModel addressModel)
        {
            // Fluent Validation :
            // (also integrated into Swagger in Startup.cs)
            var validator = new AddressModelValidator(_serviceProvider);

            validator.ValidateAndThrow <AddressModel>(addressModel);

            return(Ok(addressModel));
        }
コード例 #2
0
 public AddressTests()
 {
     _validator = new AddressModelValidator();
 }
コード例 #3
0
 public AddressModel()
 {
     validator = new AddressModelValidator();
 }