public void SetName(string name) { DomainPreconditions.NotNull(name, nameof(name)); DomainPreconditions.LongerThan(name, NAME_MAX_LENGTH, nameof(name)); Name = name; }
private static void ValidateLicensePlate(string licensePlate) { DomainPreconditions.NotNull(licensePlate, nameof(LicensePlate)); DomainPreconditions.NotEmpty(licensePlate, nameof(LicensePlate)); DomainPreconditions.LongerThan(licensePlate, LicensePlateMaxLengh, nameof(LicensePlate)); }
private static void ValidateModel(string model) { DomainPreconditions.NotNull(model, nameof(Model)); DomainPreconditions.NotEmpty(model, nameof(Model)); DomainPreconditions.LongerThan(model, ModelMaxLengh, nameof(Model)); }
private static void ValidateCarFrame(string carFrame) { DomainPreconditions.NotNull(carFrame, nameof(CarFrame)); DomainPreconditions.NotEmpty(carFrame, nameof(CarFrame)); DomainPreconditions.LongerThan(carFrame, CarFrameMaxLengh, nameof(CarFrame)); }
private static void ValidateName(string name) { DomainPreconditions.NotEmpty(name, nameof(name)); DomainPreconditions.LongerThan(name, NameMaxLength, nameof(Name)); DomainPreconditions.ShorterThan(name, NameMinLength, nameof(Name)); }
private static void ValidateEmail(string email) { DomainPreconditions.NotEmpty(email, nameof(Email)); DomainPreconditions.RegexMatch(email, EmailRegex, nameof(Email)); DomainPreconditions.LongerThan(email, EmailMaxLength, nameof(Email)); }