/// <summary>
 /// Max length.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="ruleBuilderInitial"></param>
 /// <returns></returns>
 public static IRuleBuilderInitial <T, string> MaxLength <T>(this IRuleBuilderInitial <T, string> ruleBuilderInitial, int maxlength)
 {
     ruleBuilderInitial
     .MaximumLength(maxlength)
     .WithMessage("{PropertyName}长度不能超过{MaxLength}");
     return(ruleBuilderInitial);
 }
 public static void County <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.CountyMaxLength)
     .WithMessage($"County must be {Constants.CountyMaxLength} characters or less")
     .Matches(_countyPattern)
     .WithMessage("County must only include letters a to z, numbers, hyphens and spaces");
 }
 public static void AddressLine2 <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.AddressLine2MaxLength)
     .WithMessage($"Address line 2 must be {Constants.AddressLine2MaxLength} characters or less")
     .Matches(_addressLinePattern)
     .WithMessage("Address line 2 must only include letters a to z, numbers, hyphens and spaces");
 }
Exemple #4
0
 public static void WhatYouWillLearn <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.WhatYouWillLearnMaxLength)
     .WithMessageFromErrorCode("COURSE_WHAT_YOU_WILL_LEARN_MAXLENGTH");
 }
 public static void CourseDirectoryName <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.CourseDirectoryNameMaxLength)
     .WithMessage($"Course Directory name must be {Constants.CourseDirectoryNameMaxLength} characters or fewer");
 }
 public static void Alias <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.AliasMaxLength)
     .WithMessage($"Alias must be {Constants.AliasMaxLength} characters or fewer");
 }
Exemple #7
0
 public static void WhereNext <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.WhereNextMaxLength)
     .WithMessageFromErrorCode("COURSE_WHERE_NEXT_MAXLENGTH");
 }
Exemple #8
0
 public static void CostDescription <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.CostDescriptionMaxLength)
     .WithMessageFromErrorCode("COURSERUN_COST_DESCRIPTION_MAXLENGTH");
 }
Exemple #9
0
 public static void WhatYouCanDoNextLearn <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.WhatYouCanDoNextMaxLength)
     .WithMessageFromErrorCode("COURSE_WHAT_YOU_CAN_DO_NEXT_MAXLENGTH");
 }
Exemple #10
0
 public static void WhatYouWillNeedToBring <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.WhatYouWillNeedToBringMaxLength)
     .WithMessageFromErrorCode("COURSE_WHAT_YOU_WILL_NEED_TO_BRING_MAXLENGTH");
 }
Exemple #11
0
 public static void HowYouWillBeAssessed <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.HowYouWillBeAssessedMaxLength)
     .WithMessageFromErrorCode("COURSE_HOW_YOU_WILL_BE_ASSESSED_MAXLENGTH");
 }
Exemple #12
0
 public static void EntryRequirements <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.EntryRequirementsMaxLength)
     .WithMessage($"Entry requirements must be {Constants.EntryRequirementsMaxLength} characters or fewer");
 }
Exemple #13
0
 public static void EntryRequirements <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.EntryRequirementsMaxLength)
     .WithMessageFromErrorCode("COURSE_ENTRY_REQUIREMENTS_MAXLENGTH");
 }
Exemple #14
0
 public static void YourReference <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.YourReferenceMaxLength)
     .WithMessage($"Your reference must be {Constants.YourReferenceMaxLength} characters or fewer");
 }
Exemple #15
0
 public static void WhatYoullLearn <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.WhatYoullLearnMaxLength)
     .WithMessage($"What you'll learn must be {Constants.WhatYoullLearnMaxLength} characters or fewer");
 }
Exemple #16
0
 public static void WhatYouCanDoNext <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.WhatYouCanDoNextMaxLength)
     .WithMessage($"What you can do next must be {Constants.WhatYouCanDoNextMaxLength} characters or fewer");
 }
Exemple #17
0
 public static void HowYoullBeAssessed <T>(this IRuleBuilderInitial <T, string> field)
 {
     field
     .MaximumLength(Constants.HowYoullBeAssessedMaxLength)
     .WithMessage($"How you'll be assessed must be {Constants.HowYoullBeAssessedMaxLength} characters or fewer");
 }