{"id":370592,"date":"2024-05-21T04:28:51","date_gmt":"2024-05-21T04:28:51","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=370592"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T04:28:51","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=370592","title":{"rendered":"<span>\u041e\u0431\u0437\u043e\u0440 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 FluentValidation. \u0427\u0430\u0441\u0442\u044c 7.1. \u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/db0\/a64\/3d2\/db0a643d2c2724be3e2fb74b3cde7090.png\" width=\"1000\" height=\"1000\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/db0\/a64\/3d2\/db0a643d2c2724be3e2fb74b3cde7090.png\"\/><\/figure>\n<h2>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b:<\/h2>\n<ul>\n<li>\n<p><code>NotNull<\/code> (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e <code>null<\/code>)<\/p>\n<\/li>\n<li>\n<p><code>Null<\/code> (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0432\u043d\u043e <code>null<\/code>)<\/p>\n<\/li>\n<li>\n<p><code>NotEmpty<\/code> (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e <code>null<\/code>, \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c, <code>0<\/code> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438)<\/p>\n<\/li>\n<li>\n<p><code>Empty<\/code>\u00a0(\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0432\u043d\u043e <code>null<\/code>, \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c, <code>0<\/code> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438)<\/p>\n<\/li>\n<li>\n<p><code>NotEqual<\/code> (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043b\u0438\u0431\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443)<\/p>\n<\/li>\n<li>\n<p><code>Equal<\/code>\u00a0(\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043b\u0438\u0431\u043e \u0440\u0430\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443)<\/p>\n<\/li>\n<\/ul>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432:<\/h2>\n<ul>\n<li>\n<p><code>NotNull<\/code> <\/p>\n<\/li>\n<li>\n<p><code>Null<\/code><\/p>\n<\/li>\n<li>\n<p><code>NotEmpty<\/code> <\/p>\n<\/li>\n<li>\n<p><code>Empty<\/code>\u00a0<\/p>\n<\/li>\n<li>\n<p><code>NotEqual<\/code> <\/p>\n<\/li>\n<li>\n<p><code>Equal<\/code>\u00a0<\/p>\n<\/li>\n<li>\n<p><code>Length<\/code>\u00a0<\/p>\n<\/li>\n<li>\n<p><code>MaximumLength<\/code>\u00a0<\/p>\n<\/li>\n<li>\n<p><code>MinimumLength<\/code>\u00a0<\/p>\n<\/li>\n<li>\n<p><code>LessThan<\/code>\u00a0<\/p>\n<\/li>\n<li>\n<p><code>LessThanOrEqual<\/code><\/p>\n<\/li>\n<li>\n<p><code>GreaterThan<\/code><\/p>\n<\/li>\n<li>\n<p><code>GreaterThanOrEqual<\/code><\/p>\n<\/li>\n<li>\n<p><code>Must<\/code><\/p>\n<\/li>\n<li>\n<p><code>Matches<\/code><\/p>\n<\/li>\n<li>\n<p><code>EmailAddress<\/code><\/p>\n<\/li>\n<li>\n<p><code>CreditCard<\/code><\/p>\n<\/li>\n<li>\n<p><code>IsInEnum<\/code><\/p>\n<\/li>\n<li>\n<p><code>IsEnumName<\/code><\/p>\n<\/li>\n<li>\n<p><code>ExclusiveBetween<\/code><\/p>\n<\/li>\n<li>\n<p><code>InclusiveBetween<\/code><\/p>\n<\/li>\n<li>\n<p><code>PrecisionScale<\/code><\/p>\n<\/li>\n<\/ul>\n<h2>\u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 NotNull.<\/h2>\n<h3>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:<\/h3>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e\u00a0<code>null<\/code>.<br \/><a href=\"https:\/\/github.com\/FluentValidation\/FluentValidation\/blob\/main\/src\/FluentValidation\/Validators\/NotNullValidator.cs\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430<\/a><\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430:<\/h3>\n<pre><code class=\"cs\">\/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u0430\u0434\u0440\u0435\u0441\u0430 public class Address {   \/\/ \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u0434\u0440\u0435\u0441   public string? Actual { get; set; } }  \/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class Customer {   \/\/ \u0410\u0434\u0440\u0435\u0441   public Address? Address { get; set; } }  \/\/ \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class CustomerValidator : AbstractValidator&lt;Customer> {   public CustomerValidator()   {     \/\/ \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e Actual \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u0440\u0430\u0432\u043d\u043e null     RuleFor(customer => customer.Address.Actual)       .NotNull();   } }  \/\/ \u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e static void Main(string[] args) {   ValidatorOptions.Global.LanguageManager.Culture = new CultureInfo(\"ru-RU\");    \/\/ \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435   var customer = new Customer   {     Address = new()     {       Actual = null     }   };      var validator = new CustomerValidator();   var result = validator.Validate(customer);    Console.WriteLine(result.ToString(Environment.NewLine)); }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438:<\/h3>\n<pre><code class=\"powershell\">'Address Actual' \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e.<\/code><\/pre>\n<h3>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0438:<\/h3>\n<p><code>{PropertyName}<\/code>\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyValue}<\/code>\u00a0\u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyPath}<\/code>\u00a0\u2014 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"cs\">RuleFor(customer => customer.Address.Actual)   .NotNull()     .WithMessage(\"PropertyName: {PropertyName}\\n\" +     \"PropertyValue: {PropertyValue}\\n\" +     \"PropertyPath: {PropertyPath}\");<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"powershell\">PropertyName: Address Actual PropertyValue: PropertyPath: Address.Actual<\/code><\/pre>\n<h2>\u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 Null.<\/h2>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e\u00a0<code>null<\/code>.<br \/><a href=\"https:\/\/github.com\/FluentValidation\/FluentValidation\/blob\/main\/src\/FluentValidation\/Validators\/NullValidator.cs\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430<\/a><\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430:<\/h3>\n<pre><code class=\"cs\">\/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u0430\u0434\u0440\u0435\u0441\u0430 public class Address {   \/\/ \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u0434\u0440\u0435\u0441   public string? Actual { get; set; } }  \/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class Customer {   \/\/ \u0410\u0434\u0440\u0435\u0441   public Address? Address { get; set; } }  \/\/ \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class CustomerValidator : AbstractValidator&lt;Customer> {   public CustomerValidator()   {     \/\/ \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e Actual \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e null     RuleFor(customer => customer.Address.Actual)       .Null();   } }  \/\/ \u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e static void Main(string[] args) {   ValidatorOptions.Global.LanguageManager.Culture = new CultureInfo(\"ru-RU\");    \/\/ \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435   var customer = new Customer   {     Address = new()     {       Actual = \"SomeAddress\"     }   };    var validator = new CustomerValidator();   var result = validator.Validate(customer);    Console.WriteLine(result.ToString(Environment.NewLine)); }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438:<\/h3>\n<pre><code class=\"powershell\">'Address Actual' \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c.<\/code><\/pre>\n<h3>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0438:<\/h3>\n<p><code>{PropertyName}<\/code>\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyValue}<\/code>\u00a0\u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyPath}<\/code>\u00a0\u2014 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"cs\">RuleFor(customer => customer.Address.Actual)   .Null()     .WithMessage(\"PropertyName: {PropertyName}\\n\" +     \"PropertyValue: {PropertyValue}\\n\" +     \"PropertyPath: {PropertyPath}\");<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"powershell\">PropertyName: Address Actual PropertyValue: SomeAddress PropertyPath: Address.Actual<\/code><\/pre>\n<h2>\u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 NotEmpty.<\/h2>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e\u00a0<code>null<\/code>, \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c \u043b\u0438\u0431\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<code>0<\/code>\u00a0\u0434\u043b\u044f \u0442\u0438\u043f\u0430\u00a0<code>int<\/code>. \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0442\u0438\u043f\u0435\u00a0<code>IEnumerable<\/code>, \u0438\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c \u043e\u0442 \u043d\u0435\u0433\u043e (\u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0438 \u0442. \u0434.), \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0445\u00a0\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442.<br \/><a href=\"https:\/\/github.com\/FluentValidation\/FluentValidation\/blob\/main\/src\/FluentValidation\/Validators\/NotEmptyValidator.cs\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430<\/a><\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430:<\/h3>\n<pre><code class=\"cs\">\/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u0430\u0434\u0440\u0435\u0441\u0430 public class Address {   \/\/ \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u0434\u0440\u0435\u0441   public string? Actual { get; set; } }  \/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class Customer {   \/\/ \u0410\u0434\u0440\u0435\u0441   public Address? Address { get; set; } }  \/\/ \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class CustomerValidator : AbstractValidator&lt;Customer> {   public CustomerValidator()   {     \/\/ \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e Actual \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u0440\u0430\u0432\u043d\u043e null, \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c     RuleFor(customer => customer.Address.Actual)       .NotEmpty();   } }  \/\/ \u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e static void Main(string[] args) {   ValidatorOptions.Global.LanguageManager.Culture = new CultureInfo(\"ru-RU\");    \/\/ \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435   var customer = new Customer   {     Address = new()     {       Actual = \"\"     }   };    var validator = new CustomerValidator();   var result = validator.Validate(customer);    Console.WriteLine(result.ToString(Environment.NewLine)); }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438:<\/h3>\n<pre><code class=\"powershell\">'Address Actual' \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e.<\/code><\/pre>\n<h3>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0438:<\/h3>\n<p><code>{PropertyName}<\/code>\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyValue}<\/code>\u00a0\u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyPath}<\/code>\u00a0\u2014 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"cs\">RuleFor(customer => customer.Address.Actual)   .NotEmpty()     .WithMessage(\"PropertyName: {PropertyName}\\n\" +     \"PropertyValue: {PropertyValue}\\n\" +     \"PropertyPath: {PropertyPath}\");<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"powershell\">PropertyName: Address Actual PropertyValue: PropertyPath: Address.Actual<\/code><\/pre>\n<h2>\u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 Empty.<\/h2>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e\u00a0<code>null<\/code>, \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c \u043b\u0438\u0431\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<code>0<\/code>\u00a0\u0434\u043b\u044f \u0442\u0438\u043f\u0430\u00a0<code>int<\/code>. \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0442\u0438\u043f\u0435\u00a0<code>IEnumerable<\/code>, \u0438\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c \u043e\u0442 \u043d\u0435\u0433\u043e (\u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0438 \u0442. \u0434.), \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<br \/><a href=\"https:\/\/github.com\/FluentValidation\/FluentValidation\/blob\/main\/src\/FluentValidation\/Validators\/EmptyValidator.cs\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430<\/a><\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430:<\/h3>\n<pre><code class=\"cs\">\/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u0430\u0434\u0440\u0435\u0441\u0430 public class Address {   \/\/ \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u0434\u0440\u0435\u0441   public string? Actual { get; set; } }  \/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class Customer {   \/\/ \u0410\u0434\u0440\u0435\u0441   public Address? Address { get; set; } }  \/\/ \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class CustomerValidator : AbstractValidator&lt;Customer> {   public CustomerValidator()   {     \/\/ \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e Actual \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e null, \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c     RuleFor(customer => customer.Address.Actual)       .Empty();   } }  \/\/ \u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e static void Main(string[] args) {   ValidatorOptions.Global.LanguageManager.Culture = new CultureInfo(\"ru-RU\");    \/\/ \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435   var customer = new Customer   {     Address = new()     {       Actual = \"value\"     }   };    var validator = new CustomerValidator();   var result = validator.Validate(customer);    Console.WriteLine(result.ToString(Environment.NewLine)); }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438:<\/h3>\n<pre><code class=\"powershell\">'Address Actual' \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c.<\/code><\/pre>\n<h3>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0438:<\/h3>\n<p><code>{PropertyName}<\/code>\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyValue}<\/code>\u00a0\u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyPath}<\/code>\u00a0\u2014 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"cs\">RuleFor(customer => customer.Address.Actual)   .Empty()     .WithMessage(\"PropertyName: {PropertyName}\\n\" +     \"PropertyValue: {PropertyValue}\\n\" +     \"PropertyPath: {PropertyPath}\");<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"powershell\">PropertyName: Address Actual PropertyValue: value PropertyPath: Address.Actual<\/code><\/pre>\n<h2>\u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 NotEqual.<\/h2>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e (\u0438\u043b\u0438 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430).<br \/><a href=\"https:\/\/github.com\/FluentValidation\/FluentValidation\/blob\/main\/src\/FluentValidation\/Validators\/NotEqualValidator.cs\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430<\/a><\/p>\n<h3>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 (\u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e):<\/h3>\n<pre><code class=\"cs\">\/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class Customer {   \/\/ \u041d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430   public string? PhoneNumber { get; set; } }  \/\/ \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class CustomerValidator : AbstractValidator&lt;Customer> {   public CustomerValidator()   {     \/\/ \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e PhoneNumber \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \"89998887766\"     RuleFor(customer => customer.PhoneNumber)       .NotEqual(\"89998887766\");   } }  \/\/ \u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e static void Main(string[] args) {   ValidatorOptions.Global.LanguageManager.Culture = new CultureInfo(\"ru-RU\");      \/\/ \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435   var customer = new Customer   {     PhoneNumber = \"89998887766\"   };      var validator = new CustomerValidator();   var result = validator.Validate(customer);      Console.WriteLine(result.ToString(Environment.NewLine)); }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438:<\/h3>\n<pre><code class=\"powershell\">'Phone Number' \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e '89998887766'.<\/code><\/pre>\n<h3>\u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 (\u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430):<\/h3>\n<pre><code class=\"cs\">\/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class Customer {   \/\/ \u041d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430   public string? PhoneNumber { get; set; }   \/\/ \u041d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u043b\u0438\u0446\u0430   public string? ThirdPartyPhoneNumber { get; set; } } \/\/ \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class CustomerValidator : AbstractValidator&lt;Customer> {   public CustomerValidator()   {     \/\/ \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e PhoneNumber \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e     \/\/ \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 ThirdPartyPhoneNumber     RuleFor(customer => customer.PhoneNumber)       .NotEqual(customer => customer.ThirdPartyPhoneNumber);   } } \/\/ \u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e static void Main(string[] args) {   ValidatorOptions.Global.LanguageManager.Culture = new CultureInfo(\"ru-RU\");      \/\/ \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435   var customer = new Customer   {     PhoneNumber = \"89998887766\",     ThirdPartyPhoneNumber = \"89998887766\"   };      var validator = new CustomerValidator();   var result = validator.Validate(customer);      Console.WriteLine(result.ToString(Environment.NewLine)); }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438:<\/h3>\n<pre><code class=\"powershell\">'Phone Number' \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e '89998887766'.<\/code><\/pre>\n<h3>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0438:<\/h3>\n<p><code>{PropertyName}<\/code>\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyValue}<\/code>\u00a0\u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyPath}<\/code>\u00a0\u2014 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443<\/p>\n<p><code>{ComparisonProperty}<\/code>\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/p>\n<p><code>{ComparisonValue}<\/code>\u00a0\u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/p>\n<h3>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438 (\u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e):<\/h3>\n<pre><code class=\"cs\">RuleFor(customer => customer.PhoneNumber)   .NotEqual(\"89998887766\")     .WithMessage(\"PropertyName: {PropertyName}\\n\" +     \"PropertyValue: {PropertyValue}\\n\" +     \"PropertyPath: {PropertyPath}\\n\" +     \"ComparisonProperty: {ComparisonProperty}\\n\" +     \"ComparisonValue: {ComparisonValue}\");<\/code><\/pre>\n<h3>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"powershell\">PropertyName: Phone Number PropertyValue: 89998887766 PropertyPath: PhoneNumber ComparisonProperty: ComparisonValue: 89998887766<\/code><\/pre>\n<h3>\u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438 (\u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430):<\/h3>\n<pre><code class=\"cs\">RuleFor(customer => customer.PhoneNumber)   .NotEqual(customer => customer.ThirdPartyPhoneNumber)     .WithMessage(\"PropertyName: {PropertyName}\\n\" +     \"PropertyValue: {PropertyValue}\\n\" +     \"PropertyPath: {PropertyPath}\\n\" +     \"ComparisonProperty: {ComparisonProperty}\\n\" +     \"ComparisonValue: \");<\/code><\/pre>\n<h3>\u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"powershell\">PropertyName: Phone Number PropertyValue: 89998887766 PropertyPath: PhoneNumber ComparisonProperty: Third Party Phone Number ComparisonValue: 89998887766<\/code><\/pre>\n<h2>\u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 Equal.<\/h2>\n<h3>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:<\/h3>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0440\u0430\u0432\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e (\u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e \u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430).<br \/><a href=\"https:\/\/github.com\/FluentValidation\/FluentValidation\/blob\/main\/src\/FluentValidation\/Validators\/EqualValidator.cs\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430<\/a><\/p>\n<h3>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 (\u0440\u0430\u0432\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e):<\/h3>\n<pre><code class=\"cs\">\/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u0430\u0434\u0440\u0435\u0441\u0430 public class Address {   \/\/ \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u0434\u0440\u0435\u0441   public string? Actual { get; set; } }  \/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class Customer {   \/\/ \u0410\u0434\u0440\u0435\u0441   public Address? Address { get; set; } }  \/\/ \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class CustomerValidator : AbstractValidator&lt;Customer> {   public CustomerValidator()   {     \/\/ \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e Actual \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e SomeAddress     RuleFor(customer => customer.Address.Actual)       .Equal(\"SomeAddress\");   } }  \/\/ \u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e static void Main(string[] args) {   ValidatorOptions.Global.LanguageManager.Culture = new CultureInfo(\"ru-RU\");    \/\/ \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435   var customer = new Customer   {     Address = new()     {       Actual = \"NotSomeAddress\"     }   };    var validator = new CustomerValidator();   var result = validator.Validate(customer);    Console.WriteLine(result.ToString(Environment.NewLine)); }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438:<\/h3>\n<pre><code class=\"powershell\">'Address Actual' \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e 'SomeAddress'.<\/code><\/pre>\n<h3>\u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 (\u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430):<\/h3>\n<pre><code class=\"cs\">\/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class Customer {   \/\/ \u041f\u0430\u0440\u043e\u043b\u044c   public string? Password { get; set; }   \/\/ \u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u044f   public string? PasswordConfirmation { get; set; } }  \/\/ \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class CustomerValidator : AbstractValidator&lt;Customer> {   public CustomerValidator()   {     \/\/ \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 Password \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430     \/\/ PasswordConfirmation     RuleFor(customer => customer.Password)       .Equal(customer => customer.PasswordConfirmation);   } }  \/\/ \u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e static void Main(string[] args) {   ValidatorOptions.Global.LanguageManager.Culture = new CultureInfo(\"ru-RU\");    \/\/ \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435   var customer = new Customer   {     Password = \"qwerty1\",     PasswordConfirmation = \"qwerty2\"   };    var validator = new CustomerValidator();   var result = validator.Validate(customer);    Console.WriteLine(result.ToString(Environment.NewLine)); }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438:<\/h3>\n<pre><code class=\"powershell\">'Password' \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e 'qwerty2'.<\/code><\/pre>\n<h3>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0438:<\/h3>\n<p><code>{PropertyName}<\/code>\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyValue}<\/code>\u00a0\u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyPath}<\/code>\u00a0\u2014 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443<\/p>\n<p><code>{ComparisonProperty}<\/code>\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/p>\n<p><code>{ComparisonValue}<\/code>\u00a0\u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/p>\n<h3>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438 (\u0440\u0430\u0432\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e):<\/h3>\n<pre><code class=\"cs\">RuleFor(customer => customer.Address.Actual)   .Equal(\"SomeAddress\")     .WithMessage(\"PropertyName: {PropertyName}\\n\" +     \"PropertyValue: {PropertyValue}\\n\" +     \"PropertyPath: {PropertyPath}\\n\" +     \"ComparisonProperty: {ComparisonProperty}\\n\" +     \"ComparisonValue: {ComparisonValue}\");<\/code><\/pre>\n<h3>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"powershell\">PropertyName: Address Actual PropertyValue: NotSomeAddress PropertyPath: Address.Actual ComparisonProperty: ComparisonValue: SomeAddress<\/code><\/pre>\n<h3>\u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438 (\u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430):<\/h3>\n<pre><code class=\"cs\">RuleFor(customer => customer.Password)   .Equal(customer => customer.PasswordConfirmation)     .WithMessage(\"PropertyName: {PropertyName}\\n\" +     \"PropertyValue: {PropertyValue}\\n\" +     \"PropertyPath: {PropertyPath}\\n\" +     \"ComparisonProperty: {ComparisonProperty}\\n\" +     \"ComparisonValue: {ComparisonValue}\");<\/code><\/pre>\n<h3>\u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"powershell\">PropertyName: Password PropertyValue: qwerty1 PropertyPath: Password ComparisonProperty: Password Confirmation ComparisonValue: qwerty2<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0438\u043f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u00a0<code>StringComparer<\/code>. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u0442\u043e\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u00a0<code>StringComparer.Ordinal<\/code>\u00a0(\u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430):<\/p>\n<pre><code class=\"cs\">\/\/ C\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e (\u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 \u0443\u0447\u0451\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430) RuleFor(customer => customer.Address.Actual)   .Equal(\"SomeAddress\", StringComparer.OrdinalIgnoreCase);  \/\/ \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 (\u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 \u0443\u0447\u0451\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430) RuleFor(customer => customer.Password)   .Equal(customer => customer.PasswordConfirmation, StringComparer.OrdinalIgnoreCase)<\/code><\/pre>\n<p>\u2190 <a href=\"https:\/\/habr.com\/ru\/articles\/799493\/\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/799705\/\"> https:\/\/habr.com\/ru\/articles\/799705\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<h2>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b:<\/h2>\n<ul>\n<li>\n<p><code>NotNull<\/code> (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e <code>null<\/code>)<\/p>\n<\/li>\n<li>\n<p><code>Null<\/code> (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0432\u043d\u043e <code>null<\/code>)<\/p>\n<\/li>\n<li>\n<p><code>NotEmpty<\/code> (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e <code>null<\/code>, \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c, <code>0<\/code> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438)<\/p>\n<\/li>\n<li>\n<p><code>Empty<\/code>\u00a0(\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0432\u043d\u043e <code>null<\/code>, \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c, <code>0<\/code> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438)<\/p>\n<\/li>\n<li>\n<p><code>NotEqual<\/code> (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043b\u0438\u0431\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443)<\/p>\n<\/li>\n<li>\n<p><code>Equal<\/code>\u00a0(\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043b\u0438\u0431\u043e \u0440\u0430\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443)<\/p>\n<\/li>\n<\/ul>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432:<\/h2>\n<ul>\n<li>\n<p><code>NotNull<\/code> <\/p>\n<\/li>\n<li>\n<p><code>Null<\/code><\/p>\n<\/li>\n<li>\n<p><code>NotEmpty<\/code> <\/p>\n<\/li>\n<li>\n<p><code>Empty<\/code>\u00a0<\/p>\n<\/li>\n<li>\n<p><code>NotEqual<\/code> <\/p>\n<\/li>\n<li>\n<p><code>Equal<\/code>\u00a0<\/p>\n<\/li>\n<li>\n<p><code>Length<\/code>\u00a0<\/p>\n<\/li>\n<li>\n<p><code>MaximumLength<\/code>\u00a0<\/p>\n<\/li>\n<li>\n<p><code>MinimumLength<\/code>\u00a0<\/p>\n<\/li>\n<li>\n<p><code>LessThan<\/code>\u00a0<\/p>\n<\/li>\n<li>\n<p><code>LessThanOrEqual<\/code><\/p>\n<\/li>\n<li>\n<p><code>GreaterThan<\/code><\/p>\n<\/li>\n<li>\n<p><code>GreaterThanOrEqual<\/code><\/p>\n<\/li>\n<li>\n<p><code>Must<\/code><\/p>\n<\/li>\n<li>\n<p><code>Matches<\/code><\/p>\n<\/li>\n<li>\n<p><code>EmailAddress<\/code><\/p>\n<\/li>\n<li>\n<p><code>CreditCard<\/code><\/p>\n<\/li>\n<li>\n<p><code>IsInEnum<\/code><\/p>\n<\/li>\n<li>\n<p><code>IsEnumName<\/code><\/p>\n<\/li>\n<li>\n<p><code>ExclusiveBetween<\/code><\/p>\n<\/li>\n<li>\n<p><code>InclusiveBetween<\/code><\/p>\n<\/li>\n<li>\n<p><code>PrecisionScale<\/code><\/p>\n<\/li>\n<\/ul>\n<h2>\u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 NotNull.<\/h2>\n<h3>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:<\/h3>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e\u00a0<code>null<\/code>.<br \/><a href=\"https:\/\/github.com\/FluentValidation\/FluentValidation\/blob\/main\/src\/FluentValidation\/Validators\/NotNullValidator.cs\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430<\/a><\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430:<\/h3>\n<pre><code class=\"cs\">\/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u0430\u0434\u0440\u0435\u0441\u0430 public class Address {   \/\/ \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u0434\u0440\u0435\u0441   public string? Actual { get; set; } }  \/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class Customer {   \/\/ \u0410\u0434\u0440\u0435\u0441   public Address? Address { get; set; } }  \/\/ \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class CustomerValidator : AbstractValidator&lt;Customer> {   public CustomerValidator()   {     \/\/ \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e Actual \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u0440\u0430\u0432\u043d\u043e null     RuleFor(customer => customer.Address.Actual)       .NotNull();   } }  \/\/ \u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e static void Main(string[] args) {   ValidatorOptions.Global.LanguageManager.Culture = new CultureInfo(\"ru-RU\");    \/\/ \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435   var customer = new Customer   {     Address = new()     {       Actual = null     }   };      var validator = new CustomerValidator();   var result = validator.Validate(customer);    Console.WriteLine(result.ToString(Environment.NewLine)); }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438:<\/h3>\n<pre><code class=\"powershell\">'Address Actual' \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e.<\/code><\/pre>\n<h3>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0438:<\/h3>\n<p><code>{PropertyName}<\/code>\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyValue}<\/code>\u00a0\u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyPath}<\/code>\u00a0\u2014 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"cs\">RuleFor(customer => customer.Address.Actual)   .NotNull()     .WithMessage(\"PropertyName: {PropertyName}\\n\" +     \"PropertyValue: {PropertyValue}\\n\" +     \"PropertyPath: {PropertyPath}\");<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"powershell\">PropertyName: Address Actual PropertyValue: PropertyPath: Address.Actual<\/code><\/pre>\n<h2>\u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 Null.<\/h2>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e\u00a0<code>null<\/code>.<br \/><a href=\"https:\/\/github.com\/FluentValidation\/FluentValidation\/blob\/main\/src\/FluentValidation\/Validators\/NullValidator.cs\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430<\/a><\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430:<\/h3>\n<pre><code class=\"cs\">\/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u0430\u0434\u0440\u0435\u0441\u0430 public class Address {   \/\/ \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u0434\u0440\u0435\u0441   public string? Actual { get; set; } }  \/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class Customer {   \/\/ \u0410\u0434\u0440\u0435\u0441   public Address? Address { get; set; } }  \/\/ \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class CustomerValidator : AbstractValidator&lt;Customer> {   public CustomerValidator()   {     \/\/ \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e Actual \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e null     RuleFor(customer => customer.Address.Actual)       .Null();   } }  \/\/ \u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e static void Main(string[] args) {   ValidatorOptions.Global.LanguageManager.Culture = new CultureInfo(\"ru-RU\");    \/\/ \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435   var customer = new Customer   {     Address = new()     {       Actual = \"SomeAddress\"     }   };    var validator = new CustomerValidator();   var result = validator.Validate(customer);    Console.WriteLine(result.ToString(Environment.NewLine)); }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438:<\/h3>\n<pre><code class=\"powershell\">'Address Actual' \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c.<\/code><\/pre>\n<h3>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0438:<\/h3>\n<p><code>{PropertyName}<\/code>\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyValue}<\/code>\u00a0\u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyPath}<\/code>\u00a0\u2014 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"cs\">RuleFor(customer => customer.Address.Actual)   .Null()     .WithMessage(\"PropertyName: {PropertyName}\\n\" +     \"PropertyValue: {PropertyValue}\\n\" +     \"PropertyPath: {PropertyPath}\");<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"powershell\">PropertyName: Address Actual PropertyValue: SomeAddress PropertyPath: Address.Actual<\/code><\/pre>\n<h2>\u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 NotEmpty.<\/h2>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e\u00a0<code>null<\/code>, \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c \u043b\u0438\u0431\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<code>0<\/code>\u00a0\u0434\u043b\u044f \u0442\u0438\u043f\u0430\u00a0<code>int<\/code>. \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0442\u0438\u043f\u0435\u00a0<code>IEnumerable<\/code>, \u0438\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c \u043e\u0442 \u043d\u0435\u0433\u043e (\u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0438 \u0442. \u0434.), \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0445\u00a0\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442.<br \/><a href=\"https:\/\/github.com\/FluentValidation\/FluentValidation\/blob\/main\/src\/FluentValidation\/Validators\/NotEmptyValidator.cs\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430<\/a><\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430:<\/h3>\n<pre><code class=\"cs\">\/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u0430\u0434\u0440\u0435\u0441\u0430 public class Address {   \/\/ \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u0434\u0440\u0435\u0441   public string? Actual { get; set; } }  \/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class Customer {   \/\/ \u0410\u0434\u0440\u0435\u0441   public Address? Address { get; set; } }  \/\/ \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class CustomerValidator : AbstractValidator&lt;Customer> {   public CustomerValidator()   {     \/\/ \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e Actual \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u0440\u0430\u0432\u043d\u043e null, \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c     RuleFor(customer => customer.Address.Actual)       .NotEmpty();   } }  \/\/ \u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e static void Main(string[] args) {   ValidatorOptions.Global.LanguageManager.Culture = new CultureInfo(\"ru-RU\");    \/\/ \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435   var customer = new Customer   {     Address = new()     {       Actual = \"\"     }   };    var validator = new CustomerValidator();   var result = validator.Validate(customer);    Console.WriteLine(result.ToString(Environment.NewLine)); }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438:<\/h3>\n<pre><code class=\"powershell\">'Address Actual' \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e.<\/code><\/pre>\n<h3>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0438:<\/h3>\n<p><code>{PropertyName}<\/code>\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyValue}<\/code>\u00a0\u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyPath}<\/code>\u00a0\u2014 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"cs\">RuleFor(customer => customer.Address.Actual)   .NotEmpty()     .WithMessage(\"PropertyName: {PropertyName}\\n\" +     \"PropertyValue: {PropertyValue}\\n\" +     \"PropertyPath: {PropertyPath}\");<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"powershell\">PropertyName: Address Actual PropertyValue: PropertyPath: Address.Actual<\/code><\/pre>\n<h2>\u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 Empty.<\/h2>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e\u00a0<code>null<\/code>, \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c \u043b\u0438\u0431\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<code>0<\/code>\u00a0\u0434\u043b\u044f \u0442\u0438\u043f\u0430\u00a0<code>int<\/code>. \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0442\u0438\u043f\u0435\u00a0<code>IEnumerable<\/code>, \u0438\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c \u043e\u0442 \u043d\u0435\u0433\u043e (\u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0438 \u0442. \u0434.), \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<br \/><a href=\"https:\/\/github.com\/FluentValidation\/FluentValidation\/blob\/main\/src\/FluentValidation\/Validators\/EmptyValidator.cs\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430<\/a><\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430:<\/h3>\n<pre><code class=\"cs\">\/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u0430\u0434\u0440\u0435\u0441\u0430 public class Address {   \/\/ \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u0434\u0440\u0435\u0441   public string? Actual { get; set; } }  \/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class Customer {   \/\/ \u0410\u0434\u0440\u0435\u0441   public Address? Address { get; set; } }  \/\/ \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class CustomerValidator : AbstractValidator&lt;Customer> {   public CustomerValidator()   {     \/\/ \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e Actual \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e null, \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c     RuleFor(customer => customer.Address.Actual)       .Empty();   } }  \/\/ \u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e static void Main(string[] args) {   ValidatorOptions.Global.LanguageManager.Culture = new CultureInfo(\"ru-RU\");    \/\/ \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435   var customer = new Customer   {     Address = new()     {       Actual = \"value\"     }   };    var validator = new CustomerValidator();   var result = validator.Validate(customer);    Console.WriteLine(result.ToString(Environment.NewLine)); }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438:<\/h3>\n<pre><code class=\"powershell\">'Address Actual' \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c.<\/code><\/pre>\n<h3>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0438:<\/h3>\n<p><code>{PropertyName}<\/code>\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyValue}<\/code>\u00a0\u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyPath}<\/code>\u00a0\u2014 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"cs\">RuleFor(customer => customer.Address.Actual)   .Empty()     .WithMessage(\"PropertyName: {PropertyName}\\n\" +     \"PropertyValue: {PropertyValue}\\n\" +     \"PropertyPath: {PropertyPath}\");<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438:<\/h3>\n<pre><code class=\"powershell\">PropertyName: Address Actual PropertyValue: value PropertyPath: Address.Actual<\/code><\/pre>\n<h2>\u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 NotEqual.<\/h2>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e (\u0438\u043b\u0438 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430).<br \/><a href=\"https:\/\/github.com\/FluentValidation\/FluentValidation\/blob\/main\/src\/FluentValidation\/Validators\/NotEqualValidator.cs\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430<\/a><\/p>\n<h3>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 (\u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e):<\/h3>\n<pre><code class=\"cs\">\/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class Customer {   \/\/ \u041d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430   public string? PhoneNumber { get; set; } }  \/\/ \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class CustomerValidator : AbstractValidator&lt;Customer> {   public CustomerValidator()   {     \/\/ \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e PhoneNumber \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \"89998887766\"     RuleFor(customer => customer.PhoneNumber)       .NotEqual(\"89998887766\");   } }  \/\/ \u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e static void Main(string[] args) {   ValidatorOptions.Global.LanguageManager.Culture = new CultureInfo(\"ru-RU\");      \/\/ \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435   var customer = new Customer   {     PhoneNumber = \"89998887766\"   };      var validator = new CustomerValidator();   var result = validator.Validate(customer);      Console.WriteLine(result.ToString(Environment.NewLine)); }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438:<\/h3>\n<pre><code class=\"powershell\">'Phone Number' \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e '89998887766'.<\/code><\/pre>\n<h3>\u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 (\u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430):<\/h3>\n<pre><code class=\"cs\">\/\/ \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class Customer {   \/\/ \u041d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430   public string? PhoneNumber { get; set; }   \/\/ \u041d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u043b\u0438\u0446\u0430   public string? ThirdPartyPhoneNumber { get; set; } } \/\/ \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 public class CustomerValidator : AbstractValidator&lt;Customer> {   public CustomerValidator()   {     \/\/ \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e PhoneNumber \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e     \/\/ \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 ThirdPartyPhoneNumber     RuleFor(customer => customer.PhoneNumber)       .NotEqual(customer => customer.ThirdPartyPhoneNumber);   } } \/\/ \u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e static void Main(string[] args) {   ValidatorOptions.Global.LanguageManager.Culture = new CultureInfo(\"ru-RU\");      \/\/ \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435   var customer = new Customer   {     PhoneNumber = \"89998887766\",     ThirdPartyPhoneNumber = \"89998887766\"   };      var validator = new CustomerValidator();   var result = validator.Validate(customer);      Console.WriteLine(result.ToString(Environment.NewLine)); }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438:<\/h3>\n<pre><code class=\"powershell\">'Phone Number' \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e '89998887766'.<\/code><\/pre>\n<h3>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0438:<\/h3>\n<p><code>{PropertyName}<\/code>\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyValue}<\/code>\u00a0\u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<p><code>{PropertyPath}<\/code>\u00a0\u2014 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443<\/p>\n<p><code>{ComparisonProperty}<\/code>\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/p>\n<p><code>{ComparisonValue}<\/code>\u00a0\u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/p>\n<h3>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438 (\u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e):<\/h3>\n<pre><code class=\"cs\">RuleFor(customer => customer.PhoneNumber)   .NotEqual(\"89998887766\")     .WithMessage(\"PropertyName: {PropertyName}\\n\" +  <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-370592","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370592","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=370592"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370592\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=370592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=370592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=370592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}