Guest User

Untitled

a guest
Oct 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.39 KB | None | 0 0
  1. public class FluentValidationKeys : StringToken
  2. {
  3. public static StringToken CREDITCARD_ERROR = new FluentValidationKeys("'{PropertyName}' is not a valid credit card number.");
  4. public static StringToken EMAIL_ERROR = new FluentValidationKeys("'{PropertyName}' is not a valid email address.");
  5. public static StringToken EQUAL_ERROR = new FluentValidationKeys("'{PropertyName}' should be equal to '{PropertyValue}'.");
  6. public static StringToken EXACT_LENGTH_ERROR = new FluentValidationKeys("'{PropertyName}' must be {MaxLength} characters in length. You entered {TotalLength} characters.");
  7. public static StringToken EXCLUSIVEBETWEEN_ERROR = new FluentValidationKeys("'{PropertyName}' must be between {From} and {To} (exclusive). You entered {Value}.");
  8. public static StringToken GREATERTHAN_ERROR = new FluentValidationKeys("'{PropertyName}' must be greater than '{ComparisonValue}'.");
  9. public static StringToken GREATERTHANOREQUAL_ERROR = new FluentValidationKeys("'{PropertyName}' must be greater than or equal to '{ComparisonValue}'.");
  10. public static StringToken INCLUSIVEBETWEEN_ERROR = new FluentValidationKeys("'{PropertyName}' must be between {From} and {To}. You entered {Value}.");
  11. public static StringToken LENGTH_ERROR = new FluentValidationKeys("'{PropertyName}' must be between {MinLength} and {MaxLength} characters. You entered {TotalLength} characters.");
  12. public static StringToken LESSTHAN_ERROR = new FluentValidationKeys("'{PropertyName}' must be less than '{ComparisonValue}'.");
  13. public static StringToken LESSTHANOREQUAL_ERROR = new FluentValidationKeys("'{PropertyName}' must be less than or equal to '{ComparisonValue}'.");
  14. public static StringToken NOTEMPTY_ERROR = new FluentValidationKeys("'{PropertyName}' should not be empty.");
  15. public static StringToken NOTNULL_ERROR = new FluentValidationKeys("'{PropertyName}' must not be empty.");
  16. public static StringToken NOTEQUAL_ERROR = new FluentValidationKeys("'{PropertyName}' should not be equal to '{PropertyValue}'.");
  17. public static StringToken PREDICATE_ERROR = new FluentValidationKeys("The specified condition was not met for '{PropertyName}'.");
  18. public static StringToken REGEX_ERROR = new FluentValidationKeys("'{PropertyName}' is not in the correct format.");
  19.  
  20. protected FluentValidationKeys(string defaultValue) : base(null, defaultValue)
  21. {
  22. }
  23. }
  24.  
  25. public class FluentValidationLocalisationAdapter
  26. {
  27. /// <summary>
  28. /// Looks up a localized string similar to &apos;{PropertyName}&apos; is not a valid credit card number..
  29. /// </summary>
  30. public static StringToken CreditCardError
  31. {
  32. get { return FluentValidationKeys.CREDITCARD_ERROR; }
  33. }
  34.  
  35. /// <summary>
  36. /// Looks up a localized string similar to &apos;{PropertyName}&apos; is not a valid email address..
  37. /// </summary>
  38. public static StringToken email_error
  39. {
  40. get { return FluentValidationKeys.EMAIL_ERROR; }
  41. }
  42.  
  43. /// <summary>
  44. /// Looks up a localized string similar to &apos;{PropertyName}&apos; should be equal to &apos;{PropertyValue}&apos;..
  45. /// </summary>
  46. public static StringToken equal_error
  47. {
  48. get { return FluentValidationKeys.EQUAL_ERROR; }
  49. }
  50.  
  51. /// <summary>
  52. /// Looks up a localized string similar to &apos;{PropertyName}&apos; must be {MaxLength} characters in length. You entered {TotalLength} characters..
  53. /// </summary>
  54. public static StringToken exact_length_error
  55. {
  56. get { return FluentValidationKeys.EXACT_LENGTH_ERROR; }
  57. }
  58.  
  59. /// <summary>
  60. /// Looks up a localized string similar to &apos;{PropertyName}&apos; must be between {From} and {To} (exclusive). You entered {Value}..
  61. /// </summary>
  62. public static StringToken exclusivebetween_error
  63. {
  64. get { return FluentValidationKeys.EXCLUSIVEBETWEEN_ERROR; }
  65. }
  66.  
  67. /// <summary>
  68. /// Looks up a localized string similar to &apos;{PropertyName}&apos; must be greater than &apos;{ComparisonValue}&apos;..
  69. /// </summary>
  70. public static StringToken greaterthan_error
  71. {
  72. get { return FluentValidationKeys.GREATERTHAN_ERROR; }
  73. }
  74.  
  75. /// <summary>
  76. /// Looks up a localized string similar to &apos;{PropertyName}&apos; must be greater than or equal to &apos;{ComparisonValue}&apos;..
  77. /// </summary>
  78. public static StringToken greaterthanorequal_error
  79. {
  80. get { return FluentValidationKeys.GREATERTHANOREQUAL_ERROR; }
  81. }
  82.  
  83. /// <summary>
  84. /// Looks up a localized string similar to &apos;{PropertyName}&apos; must be between {From} and {To}. You entered {Value}..
  85. /// </summary>
  86. public static StringToken inclusivebetween_error
  87. {
  88. get { return FluentValidationKeys.INCLUSIVEBETWEEN_ERROR; }
  89. }
  90.  
  91. /// <summary>
  92. /// Looks up a localized string similar to &apos;{PropertyName}&apos; must be between {MinLength} and {MaxLength} characters. You entered {TotalLength} characters..
  93. /// </summary>
  94. public static StringToken length_error
  95. {
  96. get { return FluentValidationKeys.LENGTH_ERROR; }
  97. }
  98.  
  99. /// <summary>
  100. /// Looks up a localized string similar to &apos;{PropertyName}&apos; must be less than &apos;{ComparisonValue}&apos;..
  101. /// </summary>
  102. public static StringToken lessthan_error
  103. {
  104. get { return FluentValidationKeys.LESSTHAN_ERROR; }
  105. }
  106.  
  107. /// <summary>
  108. /// Looks up a localized string similar to &apos;{PropertyName}&apos; must be less than or equal to &apos;{ComparisonValue}&apos;..
  109. /// </summary>
  110. public static StringToken lessthanorequal_error
  111. {
  112. get { return FluentValidationKeys.LESSTHANOREQUAL_ERROR; }
  113. }
  114.  
  115. /// <summary>
  116. /// Looks up a localized string similar to &apos;{PropertyName}&apos; should not be empty..
  117. /// </summary>
  118. public static StringToken notempty_error
  119. {
  120. get { return FluentValidationKeys.NOTEMPTY_ERROR; }
  121. }
  122.  
  123. /// <summary>
  124. /// Looks up a localized string similar to &apos;{PropertyName}&apos; should not be equal to &apos;{PropertyValue}&apos;..
  125. /// </summary>
  126. public static StringToken notequal_error
  127. {
  128. get { return FluentValidationKeys.NOTEQUAL_ERROR; }
  129. }
  130.  
  131. /// <summary>
  132. /// Looks up a localized string similar to &apos;{PropertyName}&apos; must not be empty..
  133. /// </summary>
  134. public static StringToken notnull_error
  135. {
  136. get { return FluentValidationKeys.NOTNULL_ERROR; }
  137. }
  138.  
  139. /// <summary>
  140. /// Looks up a localized string similar to The specified condition was not met for &apos;{PropertyName}&apos;..
  141. /// </summary>
  142. public static StringToken predicate_error
  143. {
  144. get { return FluentValidationKeys.PREDICATE_ERROR; }
  145. }
  146.  
  147. /// <summary>
  148. /// Looks up a localized string similar to &apos;{PropertyName}&apos; is not in the correct format..
  149. /// </summary>
  150. public static StringToken regex_error
  151. {
  152. get { return FluentValidationKeys.REGEX_ERROR; }
  153. }
  154. }
Add Comment
Please, Sign In to add comment