{"id":265979,"date":"2015-09-19T09:24:02","date_gmt":"2015-09-19T05:24:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=265979"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=265979","title":{"rendered":"Functional C#: \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438"},"content":{"rendered":"<p>       \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441\u043e \u0441\u0431\u043e\u044f\u043c\u0438 \u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0432\u0432\u043e\u0434\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435.<\/p>\n<ul>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/266873\/\">Functional C#: Immutability<\/a>  <\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/266937\/\">Functional C#: Primitive obsession<\/a>  <\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/267063\/\">Functional C#: Non-nullable reference types<\/a>  <\/li>\n<li><b>Functional C#: \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438<\/b>  <\/li>\n<\/ul>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0432 C#: \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434<\/h2>\n<p>  \u041a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430, \u043d\u043e \u043a\u043e\u0434, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0435\u0441\u044c\u043c\u0430 \u043d\u0435\u0443\u043a\u043b\u044e\u0436\u0438\u043c \u0432 \u0442\u0430\u043a\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043a\u0430\u043a C#. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043f\u043e\u0434 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0442 Railway Oriented Programming \u2014 \u0438\u0434\u0435\u0438, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0421\u043a\u043e\u0442\u043e\u043c \u0412\u043b\u0430\u0448\u0438\u043d\u044b\u043c (Scott Wlaschin) \u0432 <a href=\"http:\/\/fsharpforfunandprofit.com\/rop\/\">\u0435\u0433\u043e \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u043d\u0430 NDC Oslo.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u0434 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code>[HttpPost] public HttpResponseMessage CreateCustomer(string name, string billingInfo) {     Customer customer = new Customer(name);       _repository.Save(customer);       _paymentGateway.ChargeCommission(billingInfo);       _emailSender.SendGreetings(name);       return new HttpResponseMessage(HttpStatusCode.OK); } <\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 \u043f\u0440\u043e\u0441\u0442 \u0438 \u043f\u043e\u043d\u044f\u0442\u0435\u043d. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u0435\u0440\u0430, \u043f\u043e\u0442\u043e\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0435\u0433\u043e, \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0447\u0430\u0440\u0436\u0438\u043c \u043a\u043e\u043c\u0438\u0441\u0441\u0438\u044e \u0438, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0438\u0441\u044c\u043c\u043e \u0441 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435\u043c. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0434\u0435\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u2014 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0451 \u0438\u0434\u0435\u0442 \u043f\u043e \u043f\u043b\u0430\u043d\u0443.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0435\u0443\u0434\u0430\u0447\u0438, \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u0432\u043e\u0434\u0430 \u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043c\u0435\u0442\u043e\u0434 \u0441\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442\u0441\u044f:<\/p>\n<pre><code>[HttpPost] public HttpResponseMessage CreateCustomer(string name, string billingInfo) {     Result&lt;CustomerName&gt; customerNameResult = CustomerName.Create(name);     if (customerNameResult.Failure)     {         _logger.Log(customerNameResult.Error);         return Error(customerNameResult.Error);     }       Result&lt;BillingInfo&gt; billingInfoResult = BillingInfo.Create(billingInfo);     if (billingInfoResult.Failure)     {         _logger.Log(billingInfoResult.Error);         return Error(billingInfoResult.Error);     }       Customer customer = new Customer(customerNameResult.Value);       try     {         _repository.Save(customer);     }     catch (SqlException)     {         _logger.Log(\u201cUnable to connect to database\u201d);         return Error(\u201cUnable to connect to database\u201d);     }       _paymentGateway.ChargeCommission(billingInfoResult.Value);       _emailSender.SendGreetings(customerNameResult.Value);       return new HttpResponseMessage(HttpStatusCode.OK); } <\/code><\/pre>\n<p>  \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043e\u0431\u043e\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u2014 Save \u0438 ChargeCommission, \u2014 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0435: \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0442\u043a\u0430\u0442\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u0435\u0439:<\/p>\n<pre><code>[HttpPost] public HttpResponseMessage CreateCustomer(string name, string billingInfo) {     Result&lt;CustomerName&gt; customerNameResult = CustomerName.Create(name);     if (customerNameResult.Failure)     {         _logger.Log(customerNameResult.Error);         return Error(customerNameResult.Error);     }       Result&lt;BillingInfo&gt; billingIntoResult = BillingInfo.Create(billingInfo);     if (billingIntoResult.Failure)     {         _logger.Log(billingIntoResult.Error);         return Error(billingIntoResult.Error);     }       try     {         _paymentGateway.ChargeCommission(billingIntoResult.Value);     }     catch (FailureException)     {         _logger.Log(\u201cUnable to connect to payment gateway\u201d);         return Error(\u201cUnable to connect to payment gateway\u201d);     }       Customer customer = new Customer(customerNameResult.Value);     try     {         _repository.Save(customer);     }     catch (SqlException)     {         _paymentGateway.RollbackLastTransaction();         _logger.Log(\u201cUnable to connect to database\u201d);         return Error(\u201cUnable to connect to database\u201d);     }       _emailSender.SendGreetings(customerNameResult.Value);       return new HttpResponseMessage(HttpStatusCode.OK); } <\/code><\/pre>\n<p>  \u041d\u0430\u0448 5-\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432 35 \u0441\u0442\u0440\u043e\u043a, \u0442.\u0435. \u0441\u0442\u0430\u043b \u0432 7 \u0440\u0430\u0437 \u0431\u043e\u043b\u044c\u0448\u0435! \u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c, \u0442.\u043a. 5 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430, \u043d\u0435\u0441\u0443\u0449\u0438\u0445 \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u0442\u0435\u043f\u0435\u0440\u044c \u00ab\u0437\u0430\u043a\u043e\u043f\u0430\u043d\u044b\u00bb \u0432 \u043a\u0443\u0447\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<h2>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435<\/h2>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434.<\/p>\n<p>  \u0412\u044b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u0442 \u0436\u0435 \u043f\u043e\u0434\u0445\u043e\u0434, \u0447\u0442\u043e \u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u043e <a href=\"http:\/\/habrahabr.ru\/post\/266937\/\">primitive obsession<\/a>: \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d\u0438 \u0438 billing \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043c\u044b \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438\u0445 \u0432 \u043a\u043b\u0430\u0441\u0441\u044b CustomerName \u0438 BillingInfo.<\/p>\n<p>  \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 Create \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 Result, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0432\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043a\u0430\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438: \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u0443\u0434\u0430\u043b\u0430\u0441\u044c \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0431\u043b\u043e\u043a\u0430\u043c\u0438 try\/catch. \u042d\u0442\u043e <a href=\"http:\/\/habrahabr.ru\/post\/263685\/\">\u043d\u0435 \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c\u0438<\/a>, \u0442.\u043a. \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0438\u0445 \u043d\u0435 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u043d\u0438\u0436\u043d\u0435\u043c \u0443\u0440\u043e\u0432\u043d\u0435. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b ChargeCommission \u0438 Save \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 Result, \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 Create:<\/p>\n<pre><code>[HttpPost] public HttpResponseMessage CreateCustomer(string name, string billingInfo) {     Result&lt;CustomerName&gt; customerNameResult = CustomerName.Create(name);     if (customerNameResult.Failure)     {         _logger.Log(customerNameResult.Error);         return Error(customerNameResult.Error);     }       Result&lt;BillingInfo&gt; billingIntoResult = BillingInfo.Create(billingInfo);     if (billingIntoResult.Failure)     {         _logger.Log(billingIntoResult.Error);         return Error(billingIntoResult.Error);     }       Result chargeResult = _paymentGateway.ChargeCommission(billingIntoResult.Value);     if (chargeResult.Failure)     {         _logger.Log(chargeResult.Error);         return Error(chargeResult.Error);     }       Customer customer = new Customer(customerNameResult.Value);     Result saveResult = _repository.Save(customer);     if (saveResult.Failure)     {         _paymentGateway.RollbackLastTransaction();         _logger.Log(saveResult.Error);         return Error(saveResult.Error);     }       _emailSender.SendGreetings(customerNameResult.Value);       return new HttpResponseMessage(HttpStatusCode.OK); } <\/code><\/pre>\n<p>  \u041a\u043b\u0430\u0441\u0441 Result \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0445\u043e\u0436 \u0441 Maybe, \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0432\u0448\u0438\u043c\u0441\u044f \u0432 <a href=\"http:\/\/habrahabr.ru\/post\/267063\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>: \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043e\u0431\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0434, \u043d\u0435 \u0433\u043b\u044f\u0434\u044f \u043d\u0430 \u0434\u0435\u0442\u0430\u043b\u0438 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0412\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0430\u043c \u043a\u043b\u0430\u0441\u0441 (\u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u043e\u043f\u0443\u0449\u0435\u043d\u044b \u0434\u043b\u044f \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u0438):<\/p>\n<pre><code>public class Result {     public bool Success { get; private set; }     public string Error { get; private set; }     public bool Failure { \/* \u2026 *\/ }       protected Result(bool success, string error) { \/* \u2026 *\/ }       public static Result Fail(string message) { \/* \u2026 *\/ }       public static Result&lt;T&gt; Ok&lt;T&gt;(T value) {  \/* \u2026 *\/ } }   public class Result&lt;T&gt; : Result {     public T Value { get; set; }       protected internal Result(T value, bool success, string error)         : base(success, error)     {         \/* \u2026 *\/     } } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434:<\/p>\n<pre><code>[HttpPost] public HttpResponseMessage CreateCustomer(string name, string billingInfo) {     Result&lt;BillingInfo&gt; billingInfoResult = BillingInfo.Create(billingInfo);     Result&lt;CustomerName&gt; customerNameResult = CustomerName.Create(name);       return Result.Combine(billingInfoResult, customerNameResult)         .OnSuccess(() =&gt; _paymentGateway.ChargeCommission(billingInfoResult.Value))         .OnSuccess(() =&gt; new Customer(customerNameResult.Value))         .OnSuccess(             customer =&gt; _repository.Save(customer)                 .OnFailure(() =&gt; _paymentGateway.RollbackLastTransaction())         )         .OnSuccess(() =&gt; _emailSender.SendGreetings(customerNameResult.Value))         .OnBoth(result =&gt; Log(result))         .OnBoth(result =&gt; CreateResponseMessage(result)); } <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u044f\u0437\u044b\u043a\u0430\u043c\u0438, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 OnSuccess \u2014 \u044d\u0442\u043e \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 Bind \u043c\u0435\u0442\u043e\u0434. \u042f \u043d\u0430\u0437\u0432\u0430\u043b \u0435\u0433\u043e OnSuccess \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0442\u0430\u043a \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0435\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435.<\/p>\n<p>  \u041c\u0435\u0442\u043e\u0434 OnSuccess \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u0435\u0441\u043b\u0438 \u0442\u043e\u0442 \u0443\u0441\u043f\u0435\u0448\u0435\u043d, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u0435\u043b\u0435\u0433\u0430\u0442. \u0418\u043d\u0430\u0447\u0435 \u043e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0435 \u0437\u0430\u0444\u0435\u0439\u043b\u0438\u0442\u0441\u044f. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u0430 \u0442\u043e\u0439, \u0447\u0442\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0443\u0434\u0430\u0447\u0435\u0439, \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u044b.<\/p>\n<p>  \u041c\u0435\u0442\u043e\u0434 OnFailure \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0448\u043b\u0430 \u043d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u042d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0411\u0414 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c.<\/p>\n<p>  OnBoth \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0446\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u2014 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435, \u043d\u043e \u0441 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0427\u0438\u0442\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435.<\/p>\n<h2>\u0427\u0442\u043e \u043d\u0430\u0441\u0447\u0435\u0442 CQS \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430?<\/h2>\n<p>  \u0410 \u043a\u0430\u043a \u043d\u0430\u0441\u0447\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Command\u2013query_separation\">Command-Query Separation<\/a>? \u041f\u043e\u0434\u0445\u043e\u0434, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 Result) \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0441\u0430\u043c \u043c\u0435\u0442\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 (\u0442.\u0435. \u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430). \u041d\u0435 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0442 \u043b\u0438 \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 CQS?<\/p>\n<p>  \u041d\u0435\u0442. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043e\u043d \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435. \u041e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0437\u043d\u0430\u0442\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0438\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c, \u043e\u043d \u0442\u0430\u043a\u0436\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0442\u043e, \u043c\u043e\u0436\u0435\u0442 \u0438\u043b\u0438 \u043d\u0435\u0442 \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043e\u043a\u043e\u043d\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u0435\u0439.<\/p>\n<p>  \u041f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u043c\u0435\u0442\u043e\u0434\u0430. \u0412\u043c\u0435\u0441\u0442\u043e \u0434\u0432\u0443\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 (void \u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432), \u043c\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u043c\u0435\u0435\u043c 4.<\/p>\n<p>  <b>\u041c\u0435\u0442\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u0435\u0439<\/b>:<\/p>\n<pre><code>public void Save(Customer customer) <\/code><\/pre>\n<p>  <b>\u041c\u0435\u0442\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u0435\u0439<\/b>:<\/p>\n<pre><code>public Customer GetById(long id) <\/code><\/pre>\n<p>  <b>\u041c\u0435\u0442\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u0435\u0439<\/b>:<\/p>\n<pre><code>public Result Save(Customer customer) <\/code><\/pre>\n<p>  <b>\u041c\u0435\u0442\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u0435\u0439<\/b>:<\/p>\n<pre><code>public Result&lt;Customer&gt; GetById(long id) <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 Customer, \u0430 \u043d\u0435 Result&lt;Customer&gt;, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0435\u0443\u0434\u0430\u0447\u0430 \u0432 \u0442\u0430\u043a\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 <a href=\"http:\/\/habrahabr.ru\/post\/263685\/\">\u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439<\/a>.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0427\u0435\u0442\u043a\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0438\u0445 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u043a\u0440\u0430\u0439\u043d\u0435 \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438. \u0412 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u0441 \u0442\u0440\u0435\u043c\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430\u043c\u0438 \u2014 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 \u0442\u0438\u043f\u044b, \u043e\u0442\u0445\u043e\u0434 \u043e\u0442 \u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u0430\u043c\u0438 \u0438 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u043c\u0438 \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u2014 \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u043f\u0440\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0432\u0430\u0448\u0443 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h2>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438<\/h2>\n<p>  <a href=\"https:\/\/gist.github.com\/vkhorikov\/7852c7606f27c52bc288\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438<\/a><\/p>\n<h2>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432 \u0441\u0435\u0440\u0438\u0438<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/266873\/\">Functional C#: Immutability<\/a>  <\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/266937\/\">Functional C#: Primitive obsession<\/a>  <\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/267063\/\">Functional C#: Non-nullable reference types<\/a>  <\/li>\n<li><b>Functional C#: \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438<\/b>  <\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/267231\/\"> http:\/\/habrahabr.ru\/post\/267231\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441\u043e \u0441\u0431\u043e\u044f\u043c\u0438 \u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0432\u0432\u043e\u0434\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435.<\/p>\n<ul>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/266873\/\">Functional C#: Immutability<\/a>  <\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/266937\/\">Functional C#: Primitive obsession<\/a>  <\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/267063\/\">Functional C#: Non-nullable reference types<\/a>  <\/li>\n<li><b>Functional C#: \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438<\/b>  <\/li>\n<\/ul>\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-265979","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/265979","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=265979"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/265979\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=265979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=265979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=265979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}