This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomerValidator: AbstractValidator | |
{ | |
public CustomerValidator() | |
{ | |
RuleFor(customer => customer.Surname).NotEmpty(); | |
RuleFor(customer => customer.Forename).NotEmpty().WithMessage("Please specify a first name"); | |
RuleFor(customer => customer.Discount).NotEqual(0).When(customer => customer.HasDiscount); | |
RuleFor(customer => customer.Address).Length(20, 250); | |
RuleFor(customer => customer.Postcode).Must(BeAValidPostcode).WithMessage("Please specify a valid postcode"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EntityController : ApiController | |
{ | |
public SomeDto Get() | |
{ | |
//return some DTO | |
} | |
} |
NewerOlder