コード例 #1
0
ファイル: Venue.cs プロジェクト: VFA91/AggregateExamples
        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 ValidateModel(string model)
 {
     DomainPreconditions.NotNull(model, nameof(Model));
     DomainPreconditions.NotEmpty(model, nameof(Model));
     DomainPreconditions.LongerThan(model, ModelMaxLengh, nameof(Model));
 }
コード例 #3
0
 private static void ValidateLicensePlate(string licensePlate)
 {
     DomainPreconditions.NotNull(licensePlate, nameof(LicensePlate));
     DomainPreconditions.NotEmpty(licensePlate, nameof(LicensePlate));
     DomainPreconditions.LongerThan(licensePlate, LicensePlateMaxLengh, nameof(LicensePlate));
 }
コード例 #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 ValidateBirthdate(DateTime birthdate)
 {
     DomainPreconditions.EarlierThan(birthdate, BirthdateMaxDate, nameof(Birthdate));
     DomainPreconditions.LaterThan(birthdate, BirthdateMinDate, nameof(Birthdate));
 }
コード例 #6
0
 private static void ValidateName(string name)
 {
     DomainPreconditions.NotEmpty(name, nameof(name));
     DomainPreconditions.LongerThan(name, NameMaxLength, nameof(Name));
     DomainPreconditions.ShorterThan(name, NameMinLength, nameof(Name));
 }
コード例 #7
0
 private static void ValidateEmail(string email)
 {
     DomainPreconditions.NotEmpty(email, nameof(Email));
     DomainPreconditions.RegexMatch(email, EmailRegex, nameof(Email));
     DomainPreconditions.LongerThan(email, EmailMaxLength, nameof(Email));
 }
コード例 #8
0
 private static void ValidateGender(int genderId) =>
 DomainPreconditions.IsIntInIntList(Gender.GetGenders().Select(r => r.Id), genderId, nameof(genderId));