示例#1
0
        public void SetName(string name)
        {
            DomainPreconditions.NotNull(name, nameof(name));
            DomainPreconditions.LongerThan(name, NAME_MAX_LENGTH, nameof(name));

            Name = name;
        }
示例#2
0
 private static void ValidateLicensePlate(string licensePlate)
 {
     DomainPreconditions.NotNull(licensePlate, nameof(LicensePlate));
     DomainPreconditions.NotEmpty(licensePlate, nameof(LicensePlate));
     DomainPreconditions.LongerThan(licensePlate, LicensePlateMaxLengh, nameof(LicensePlate));
 }
示例#3
0
 private static void ValidateModel(string model)
 {
     DomainPreconditions.NotNull(model, nameof(Model));
     DomainPreconditions.NotEmpty(model, nameof(Model));
     DomainPreconditions.LongerThan(model, ModelMaxLengh, nameof(Model));
 }
示例#4
0
 private static void ValidateCarFrame(string carFrame)
 {
     DomainPreconditions.NotNull(carFrame, nameof(CarFrame));
     DomainPreconditions.NotEmpty(carFrame, nameof(CarFrame));
     DomainPreconditions.LongerThan(carFrame, CarFrameMaxLengh, nameof(CarFrame));
 }
示例#5
0
 private static void ValidateName(string name)
 {
     DomainPreconditions.NotEmpty(name, nameof(name));
     DomainPreconditions.LongerThan(name, NameMaxLength, nameof(Name));
     DomainPreconditions.ShorterThan(name, NameMinLength, nameof(Name));
 }
示例#6
0
 private static void ValidateEmail(string email)
 {
     DomainPreconditions.NotEmpty(email, nameof(Email));
     DomainPreconditions.RegexMatch(email, EmailRegex, nameof(Email));
     DomainPreconditions.LongerThan(email, EmailMaxLength, nameof(Email));
 }