XDDDEEEE gtfo Merge branch 'master' of http://git.kadet.net/system-praktyk/system-praktyk-api into doroboty finaly Co-authored-by: MaxchilKH <m.w.bohdanowicz@gmail.com>
31 lines
873 B
C#
31 lines
873 B
C#
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<BranchAddress>
|
|
{
|
|
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();
|
|
}
|
|
}
|
|
}
|
|
} |