using FluentValidation; using FluentValidation.Validators; namespace InternshipSystem.Core { public class BranchAddress { public string Street { get; set; } public string Building { get; set; } public string City { get; set; } public string PostalCode { get; set; } public string Country { get; set; } public class Validator : AbstractValidator { public Validator() { RuleFor(x => x.Country) .NotEmpty(); RuleFor(x => x.City) .NotEmpty(); RuleFor(x => x.PostalCode) .NotEmpty(); RuleFor(x => x.Street) .NotEmpty(); RuleFor(x => x.Building) .NotEmpty(); } } } }