{"id":298508,"date":"2020-02-11T09:00:23","date_gmt":"2020-02-11T09:00:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=298508"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=298508","title":{"rendered":"\u0414\u0435\u0440\u0435\u0432\u044c\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0439 (Expression Tree Visitor vs Pattern matching)"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/486972\/\">\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a. \u0414\u0435\u0440\u0435\u0432\u044c\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u0441 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u043c Visitor, \u0432\u0441\u0435\u0433\u0434\u0430 \u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u043e\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435, \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u0442\u0435\u043c \u043b\u0435\u0433\u0447\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u043c\u0441\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0447\u0442\u043e-\u0442\u043e, \u0447\u0442\u043e \u0438\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u043e.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xt\/6c\/bf\/xt6cbf1-gfkv4-64zs250n_-7pa.jpeg\"><br \/>  <a name=\"habracut\"><\/a><br \/>  \u0421\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u2014 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u0441\u043d\u043e\u0432 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0438\u0436\u0435.<\/p>\n<p>  <b><a href=\"#basic\">\u041e\u0441\u043d\u043e\u0432\u044b \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/a><\/b><br \/>   <b><a href=\"#syn\">\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/a><\/b><br \/>   <b><a href=\"#types\">\u0422\u0438\u043f\u044b \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/a><\/b><br \/>   <b><a href=\"#pm\">\u041f\u0430\u0442\u0442\u0435\u0440\u043d \u041c\u0430\u0442\u0447\u0438\u043d\u0433<\/a><\/b><br \/>   <b><a href=\"#nv\">\u041d\u0430\u0438\u0432\u043d\u044b\u0439 \u0432\u0438\u0437\u0438\u0442\u043e\u0440<\/a><\/b><br \/>   <b><a href=\"#cv\">\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u0438\u0437\u0438\u0442\u043e\u0440<\/a><\/b><\/p>\n<p>  \u041d\u0443 \u0438 \u0446\u0435\u043b\u044c\u044e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0432\u044f\u0437\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u0434\u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u0434\u0440\u0443\u0433\u043e\u0433\u043e. \u0412\u044b\u0432\u043e\u0434\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0430\u043c\u0438\u043c \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0432\u0441\u0435\u0445 \u043d\u044e\u0430\u043d\u0441\u043e\u0432 \u0432 \u0432\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u042f \u0436\u0435 \u0432\u044b\u0441\u043a\u0430\u0436\u0443 \u0441\u0432\u043e\u0435 \u043c\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435.<\/p>\n<p>  <a name=\"basic\"><\/a>  <\/p>\n<h2>\u0414\u0435\u0440\u0435\u0432\u044c\u044f \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/h2>\n<p>  <\/p>\n<h3>\u041e\u0441\u043d\u043e\u0432\u044b<\/h3>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u043c\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u041f\u043e\u0434 \u043d\u0438\u043c\u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442 \u0442\u0438\u043f Expression \u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u0435\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u0432 (\u043e \u043d\u0438\u0445 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043f\u043e\u0437\u0436\u0435). \u041f\u0440\u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\/\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430\/\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a \u0438 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u0434\u0435\u043b\u0430\u0442\u044c (\u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c). \u0422\u0438\u043f Expression \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\/\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c (\u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043b\u044f\u043c\u0431\u0434\u044b, \u043d\u043e \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e) \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0435, \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0434\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f. \u0414\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0434\u0430\u044e\u0442 \u043d\u0430\u043c \u00ab\u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439\u00bb. <\/p>\n<p>  \u0414\u043b\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043b\u044f\u043c\u0431\u0434\u0430 <\/p>\n<p>  <b><i>(\u0445) =&gt; Console.WriteLine(\u0445 + 5)<\/i><\/b><\/p>\n<p>  \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" width=\"500\" src=\"https:\/\/habrastorage.org\/webt\/yv\/wy\/sq\/yvwysqugbtttw-gvz07tipuq-oy.jpeg\"><\/div>\n<p>  \u041a\u043e\u0440\u0435\u043d\u044c \u0434\u0435\u0440\u0435\u0432\u0430 \u2014 \u0432\u0435\u0440\u0448\u0438\u043d\u0430 &quot;<b>MethodCall<\/b>&quot;, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u0435\u0442\u043e\u0434\u0430 \u2014 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432. <\/p>\n<p>  \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0442\u043e\u043c\u043e\u043a \u043e\u0434\u0438\u043d \u2014 \u0432\u0435\u0440\u0448\u0438\u043d\u0430 &quot;<b>ArithmeticOperation<\/b>&quot;. \u0412 \u043d\u0435\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0438 \u043b\u0435\u0432\u044b\u0439 \u0438 \u043f\u0440\u0430\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u044b \u2014 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0423 \u0442\u0430\u043a\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 2 \u043f\u043e\u0442\u043e\u043c\u043a\u0430. <\/p>\n<p>  \u041e\u043f\u0435\u0440\u0430\u043d\u0434\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043e\u0439 (<b>Constant<\/b>) \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c (<b>Parameter<\/b>). \u0423 \u0442\u0430\u043a\u0438\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043d\u0435\u0442 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432. <\/p>\n<p>  \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0438\u0435 \u0441\u0443\u0442\u044c. <\/p>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u2014 \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0438 \u0432\u044b\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u0435\u043b\u0430\u0442\u044c. \u0421 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f, \u044d\u0442\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c. \u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u2014 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f (\u043e\u0447\u0435\u043d\u044c \u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u043d\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0430\u044f). \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\/\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u043d\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 <i>\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430\u0445<\/i> entity framework. \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u2014 \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0434\u0435\u0440\u0435\u0432\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c\u0441\u044f \u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e <i>SQL<\/i>. \u0418\u0437 \u043c\u0435\u043d\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u043c\u043e\u043a\u0438\u043d\u0433\u0430 <i>moq<\/i>. \u0414\u0435\u0440\u0435\u0432\u044c\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0448\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 <i>DLR<\/i> (dynamic language runtime). \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0438\u0445 \u043f\u0440\u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u0438\u0440\u043e\u0434\u043e\u0439 \u0438 dotnet, \u0432\u043c\u0435\u0441\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 <i>MSIL<\/i>.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b.<br \/>  <a name=\"syn\"><\/a>  <\/p>\n<h3>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/h3>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435, \u0447\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u2014 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 2 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430: <\/p>\n<ul>\n<li>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430 Expression<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u044f\u043c\u0431\u0434\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0449\u0435\u0435\u0441\u044f \u0432 Expression<\/li>\n<\/ul>\n<p>  <\/p>\n<h4>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430 Expression<\/h4>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430 Expression \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0436\u0435 (\u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f). \u042d\u0442\u043e \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e, \u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u0432 \u043d\u0430\u0448\u0435\u043c<br \/>  \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u0438\u0440\u043f\u0438\u0447\u0438\u043a\u043e\u0432, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0435<br \/>  \u0432\u0435\u0449\u0438. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u0442.\u043a. \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438\u043c\u0435\u044e\u0442 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <i>internal<\/i>. \u0418 \u044d\u0442\u043e \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0447\u0435\u0445\u043b\u044f\u0442\u044c \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044e. <\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0448\u0435: <\/p>\n<p>  <b><i>(\u0445) =&gt; Console.WriteLine(\u0445 + 5)<\/i><\/b><\/p>\n<pre><code class=\"cs\">ParameterExpression parameter = Expression.Parameter(typeof(double)); ConstantExpression constant = Expression.Constant(5d, typeof(double)); BinaryExpression add = Expression.Add(parameter, constant); MethodInfo writeLine = typeof(Console).GetMethod(nameof(Console.WriteLine), new[] { typeof(double) }); MethodCallExpression methodCall = Expression.Call(null, writeLine, add); Expression&lt;Action&lt;double&gt;&gt; expressionlambda = Expression.Lambda&lt;Action&lt;double&gt;&gt;(methodCall, parameter); Action&lt;double&gt; delegateLambda = expressionlambda.Compile(); delegateLambda(123321); <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u0435\u0442, \u044d\u0442\u043e \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u0437\u0430\u0442\u043e \u043e\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u041f\u043b\u044e\u0441 \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u0444\u0438\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439: \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0442 \u0446\u0438\u043a\u043b\u043e\u0432, \u0443\u0441\u043b\u043e\u0432\u0438\u0439, try-catch, goto, \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f, \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044f \u0431\u043b\u043e\u043a\u0430\u043c\u0438 fault, \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u0442\u043e\u0447\u0435\u043a \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0430, dynamic \u0438 \u0442\u0434.<\/p>\n<h4>\u041b\u0430\u043c\u0431\u0434\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/h4>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u044f\u043c\u0431\u0434 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u2014 \u0431\u043e\u043b\u0435\u0435 \u0447\u0430\u0441\u0442\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0443\u043c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u0442, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0447\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043b\u044f\u043c\u0431\u0434\u0430. \u0418 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u0435\u0435 \u043b\u0438\u0431\u043e \u0432 \u0434\u0435\u043b\u0435\u0433\u0430\u0442, \u043b\u0438\u0431\u043e \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u041d\u0430 \u0443\u0436\u0435 \u043e\u0441\u0432\u043e\u0435\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/p>\n<pre><code class=\"cs\">Expression&lt;Action&lt;double&gt;&gt; write = \u0445 =&gt; Console.WriteLine(\u0445 + 5);<\/code><\/pre>\n<p>  \u0421\u0442\u043e\u0438\u0442 \u0443\u0442\u043e\u0447\u043d\u0438\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0432\u0435\u0449\u044c \u2014 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435. \u0418 \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0442\u043e\u0431\u044b <br \/>  \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0414\u0435\u0440\u0435\u0432\u044c\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0442\u0438\u043f\u0430 LambdaExpression \u0438\u043b\u0438 \u0435\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c <br \/>  c\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 IL. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e c\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b \u043a\u043e\u0434 (\u043d\u043e \u044d\u0442\u043e \u0438 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430).<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u0436\u0435 \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0432\u0435\u0440\u043d\u043e. \u0414\u0435\u043b\u0435\u0433\u0430\u0442 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0432\u0437\u044f\u0442\u044c \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c (\u043d\u043e \u044d\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e).<\/p>\n<p>  \u041d\u0435 \u0432\u0441\u0435 \u043b\u044f\u043c\u0431\u0434\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c c\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u041a \u0442\u0430\u043a\u043e\u0432\u044b\u043c \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f<\/li>\n<li>\u0421\u043e\u0434\u0435\u0440\u0449\u0430\u0449\u0438\u0435 dynamic<\/li>\n<li>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435<\/li>\n<li>C \u0442\u0435\u043b\u043e\u043c (\u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438)<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"cs\">double variable; dynamic dynamic; Expression&lt;Action&gt; assignment = () =&gt; variable = 5; \/\/Compiler error: An expression tree may not contain an assignment operator Expression&lt;Func&lt;double&gt;&gt; dynamically = () =&gt; dynamic; \/\/Compiler error: An expression tree may not contain a dynamic operation Expression&lt;Func&lt;Task&gt;&gt; asynchon = async () =&gt; await Task.CompletedTask; \/\/Compiler error: Async lambda cannot be converted to expresiion trees Expression&lt;Action&gt; body = () =&gt; { }; \/\/Compiler error: A lambda expression with a statement body cannot be converted to an expression tree <\/code><\/pre>\n<p>  <a name=\"types\"><\/a>  <\/p>\n<h3>\u0422\u0438\u043f\u044b \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/h3>\n<p>  \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0431\u0435\u0433\u043b\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0441\u044f \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043c\u044b \u0438\u043c\u0435\u0435\u043c. \u0412\u0441\u0435 \u043e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.linq.expressions?view=netstandard-2.0\">System.Linq.Expressions<\/a><\/p>\n<p>  \u042f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0441\u044f \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438 \u0438 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438. \u0411\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0442\u0438\u043f\u044b \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u044f \u0441\u043e\u0431\u0440\u0430\u043b \u0432 \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0443 \u0441 \u043a\u0440\u0430\u0442\u043a\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c.<\/p>\n<h4>Dynamic<\/h4>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DynamicExpression \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c dynamic \u0438 \u0432\u0441\u0435 \u0435\u0433\u043e \u0444\u0438\u0448\u043a\u0438 \u0432 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0422\u0430\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e\u0435 API, \u043d\u0430\u0434 \u044d\u0442\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u044f \u0441\u0438\u0434\u0435\u043b \u0434\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043d\u0430\u0434 \u0432\u0441\u0435\u043c\u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0432\u0437\u044f\u0442\u044b\u043c\u0438. \u0412\u0441\u044f \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0443\u0447\u0435\u0439 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0444\u043b\u0430\u0433\u043e\u0432. \u0418 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445 \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0438\u0449\u0438\u0442\u0435, \u043d\u043e \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043c\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f. \u0410 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 dynamic \u0432 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0433\u043e\u0432\u043e\u0440\u044f\u0449\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e. \u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cs\">var parameter1 = Expression.Parameter(typeof(object), &quot;name1&quot;); var parameter2 = Expression.Parameter(typeof(object), &quot;name2&quot;);  var dynamicParam1 = CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null); var dynamicParam2 = CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null); CallSiteBinder csb = Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.Add, typeof(Program), new[] { dynamicParam1, dynamicParam2 }); var dyno = Expression.Dynamic(csb, typeof(object), parameter1, parameter2); Expression&lt;Func&lt;dynamic, dynamic, dynamic&gt;&gt; expr = Expression.Lambda&lt;Func&lt;dynamic, dynamic, dynamic&gt;&gt;(dyno, new[] { parameter1, parameter2 }); Func&lt;dynamic, dynamic, dynamic&gt; action = expr.Compile(); var res = action(&quot;1&quot;, &quot;2&quot;); Console.WriteLine(res); \/\/12 res = action(1, 2); Console.WriteLine(res); \/\/3 <\/code><\/pre>\n<p>  \u042f \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043b, \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0435\u0442\u0441\u044f Binder \u0432\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b \u0441 \u0431\u0438\u043d\u0434\u0435\u0440\u043e\u043c \u0438\u0437 System.Reflection. \u0418\u0437 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0441\u0442\u0435\u0439 \u2014 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c ref \u0438 out \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0443\u043d\u0430\u0440\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u0430 \u0438 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0432\u0441\u0435, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 dynamic, \u043e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u043d\u043e\u0440\u043e\u0432\u043a\u0438. <\/p>\n<h4>\u0411\u043b\u043e\u043a\u0438 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/h4>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0435, \u043d\u0430 \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u2014 try\/catch\/finally\/fault \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435 \u043d\u0430 \u0442\u043e,<br \/>  \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a fault \u0431\u043b\u043e\u043a\u0443. \u041e\u043d \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 C#, \u043e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u0442\u044c \u0432 MSIL.\u042d\u0442\u043e \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0439 <br \/>  \u0430\u043d\u0430\u043b\u043e\u0433 finally, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043b\u044e\u0431\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435 \u0432\u044b\u0431\u0440\u043e\u0441\u0438\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e \u00abHi\u00bb \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0436\u0434\u0430\u0442\u044c \u0432\u0432\u043e\u0434\u0430. \u0422\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u043d\u0430 \u0443\u043f\u0430\u0434\u0435\u0442 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u041d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u044d\u0442\u0443 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0443 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e.<\/p>\n<pre><code class=\"cs\">var throwSmth = Expression.Throw(Expression.Constant(new Exception(), typeof(Exception))); var log = Expression.Call(null, typeof(Console).GetMethod(nameof(Console.WriteLine), new[] { typeof(string) }), Expression.Constant(&quot;Hi&quot;, typeof(string))); var read = Expression.Call(null, typeof(Console).GetMethod(nameof(Console.ReadLine))); var fault = Expression.TryFault(throwSmth, Expression.Block(new[] { log, read })); Expression&lt;Action&gt; expr = Expression.Lambda&lt;Action&gt;(fault); Action compiledExpression = expr.Compile(); compiledExpression(); <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/b><\/p>\n<div class=\"spoiler_text\">\n<h4>\u0422\u0430\u0431\u043b\u0438\u0446\u0430<\/h4>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<th>\u0422\u0438\u043f<\/th>\n<th>\u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/th>\n<\/tr>\n<tr>\n<td colspan=\"2\" align=\"center\"><b>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435<\/b><\/td>\n<\/tr>\n<tr>\n<td>Expression<\/td>\n<td>\u0410\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u0442\u0438\u043f, \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0439\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0422\u0430\u043a\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/td>\n<\/tr>\n<tr>\n<td>Expression&lt;TDelegate&gt;<\/td>\n<td>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0435\u0440\u0435\u0432\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043b\u044f\u043c\u0431\u0434\u044b<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\" align=\"center\"><b>\u041f\u0440\u043e\u0441\u0442\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f<\/b><\/td>\n<\/tr>\n<tr>\n<td>BinaryExpression<\/td>\n<td>\u0422\u0438\u043f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 (+, \u2014 \u0438 \u0442\u0434)<\/td>\n<\/tr>\n<tr>\n<td>UnaryExpression<\/td>\n<td>\u0423\u043d\u0430\u0440\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b(+, -), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 throw<\/td>\n<\/tr>\n<tr>\n<td>ConstantExpression<\/td>\n<td>\u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u043a\u0438\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440<\/td>\n<\/tr>\n<tr>\n<td>ParameterExpression<\/td>\n<td>\u0417\u0430\u0434\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440<\/td>\n<\/tr>\n<tr>\n<td>MethodCallExpression<\/td>\n<td>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 MethodInfo<\/td>\n<\/tr>\n<tr>\n<td>IndexExpression<\/td>\n<td>\u0418\u043d\u0434\u0435\u043a\u0441\u0430\u0442\u043e\u0440<\/td>\n<\/tr>\n<tr>\n<td>BlockExpression<\/td>\n<td>\u0411\u043b\u043e\u043a, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0412 \u043d\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\" align=\"center\"><b>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/b><\/td>\n<\/tr>\n<tr>\n<td>ConditionalExpression <\/td>\n<td>\u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u2014 if-else<\/td>\n<\/tr>\n<tr>\n<td>LabelTarget<\/td>\n<td>\u041b\u0435\u0439\u0431\u043b \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u043a\u043e\u0432 goto<\/td>\n<\/tr>\n<tr>\n<td>LabelExpression<\/td>\n<td>\u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043b\u0435\u0439\u0431\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0435\u0440\u0435\u0432\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043a\u0430\u0447\u043a\u0430 \u043a \u043d\u0435\u043c\u0443. \u0421\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 LabelTarget. \u0415\u0441\u043b\u0438 \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u0440\u044b\u0433\u043d\u0443\u043b\u0438, \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e GotoExpression, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 void, \u0442\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/td>\n<\/tr>\n<tr>\n<td>GotoExpression<\/td>\n<td>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432. (\u0412 \u0442.\u0447. \u00abbreak\u00bb)<\/td>\n<\/tr>\n<tr>\n<td>LoopExpression<\/td>\n<td>\u0411\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b, \u0432\u044b\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u00abbreak\u00bb<\/td>\n<\/tr>\n<tr>\n<td>SwitchCase<\/td>\n<td>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 SwitchExpression<\/td>\n<\/tr>\n<tr>\n<td>SwitchExpression<\/td>\n<td>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 switch\/case<\/td>\n<\/tr>\n<tr>\n<td>TryExpression<\/td>\n<td>\u0422\u0438\u043f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f try\/catch\/finally\/fault \u0431\u043b\u043e\u043a\u0430<\/td>\n<\/tr>\n<tr>\n<td>CatchBlock<\/td>\n<td>\u0422\u0438\u043f, \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0439\u0441\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c, \u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u0445 \u0432\u043d\u0443\u0442\u0440\u0438<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\" align=\"center\"><b>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/b><\/td>\n<\/tr>\n<tr>\n<td>ElementInit<\/td>\n<td>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0434\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 IEnumerable. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 ListInitExpression<\/td>\n<\/tr>\n<tr>\n<td>ListInitExpression<\/td>\n<td>\u0412\u044b\u0437\u043e\u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 + \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438<\/td>\n<\/tr>\n<tr>\n<td>DefaultExpression<\/td>\n<td>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0442\u0438\u043f\u0430 \u0438\u043b\u0438 \u043f\u0443\u0441\u0442\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435<\/td>\n<\/tr>\n<tr>\n<td>NewArrayExpression<\/td>\n<td>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 + \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/td>\n<\/tr>\n<tr>\n<td>NewExpression<\/td>\n<td>\u0412\u044b\u0437\u043e\u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\" align=\"center\"><b>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043f\u043e\u043b\u044f\u043c\u0438\/\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438<\/b><\/td>\n<\/tr>\n<tr>\n<td>MemberAssignment<\/td>\n<td>\u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044e \u0438\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430<\/td>\n<\/tr>\n<tr>\n<td>MemberBinding<\/td>\n<td>\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u044b, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u043b\u0435\u043d\u043e\u0432 \u0432\u043d\u043e\u0432\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430<\/td>\n<\/tr>\n<tr>\n<td>MemberExpression<\/td>\n<td>\u0414\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u043b\u044e\/\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443<\/td>\n<\/tr>\n<tr>\n<td>MemberInitExpression<\/td>\n<td>\u0412\u044b\u0437\u043e\u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044c\u0435\u043a\u0442\u0430<\/td>\n<\/tr>\n<tr>\n<td>MemberListBinding<\/td>\n<td>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\/\u043f\u043e\u043b\u044f \u0442\u0438\u043f\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438<\/td>\n<\/tr>\n<tr>\n<td>MemberMemberBinding<\/td>\n<td>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044f\/\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u044c\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0430\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u043c\/\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\" align=\"center\"><b>\u041f\u0440\u043e\u0447\u0435\u0435<\/b><\/td>\n<\/tr>\n<tr>\n<td>LambdaExpression<\/td>\n<td>\u041b\u044f\u043c\u0431\u0434\u0430<\/td>\n<\/tr>\n<tr>\n<td>InvocationExpression<\/td>\n<td>\u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u043d\u043e\u0435 \u0438\u043b\u0438 \u043b\u044f\u043c\u0431\u0434\u0430-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a \u0441\u043f\u0438\u0441\u043a\u0443 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/td>\n<\/tr>\n<tr>\n<td>DebugInfoExpression<\/td>\n<td>\u0417\u0430\u0434\u0430\u0435\u0442 \u0438\u043b\u0438 \u043e\u0447\u0438\u0449\u0430\u0435\u0442 \u0442\u043e\u0447\u043a\u0443 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0430 \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a\u0443 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435<\/td>\n<\/tr>\n<tr>\n<td>SymbolDocumentInfo<\/td>\n<td>\u0425\u0440\u0430\u043d\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u0445 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0434\u043b\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u044f\u0437\u044b\u043a\u0430.<\/td>\n<\/tr>\n<tr>\n<td>DynamicExpression<\/td>\n<td>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e (\u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d\u043e \u0432\u044b\u0448\u0435)<\/td>\n<\/tr>\n<tr>\n<td>RuntimeVariablesExpression<\/td>\n<td>\u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0435 \u043f\u0440\u0430\u0432\u0430 \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/td>\n<\/tr>\n<tr>\n<td>TypeBinaryExpression<\/td>\n<td>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0430\u043a\u0438\u043c \u0442\u0438\u043f\u043e\u043c (is)<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d \u0435\u0441\u0442\u044c <\/p>\n<ul>\n<li>ExpressionVisitor \u2014 \u0434\u0430\u0435\u0442 \u0432\u0438\u0437\u0438\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0437\u0436\u0435.<\/li>\n<li>DynamicExpressionVisitor \u2014 \u0441\u0434\u0435\u043b\u0430\u043d \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 DynamicExpression (\u043c\u0435\u0442\u043e\u0434 VisitDynamic)<\/li>\n<\/ul>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0445 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u043c\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u042f \u0440\u0435\u0448\u0438\u043b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u0441\u0435 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0439. \u0412\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u044f \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b \u2014 \u043b\u0438\u0448\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435. \u041d\u043e \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0437\u0430\u0447\u0435\u043c-\u0442\u043e \u0440\u0435\u0448\u0438\u043b \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u2014 \u0431\u0443\u0434\u0443 \u0440\u0430\u0434, \u0435\u0441\u043b\u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u043a\u0432\u0435\u0441\u0442 \u0432 \u043c\u043e\u0439 <a href=\"https:\/\/github.com\/ZloyChert\/DerivativeExpression\/tree\/master\/ExpressionDerivative\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a>.<\/p>\n<p>  <a name=\"pm\"><\/a>  <\/p>\n<h2>\u0421\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u043c (pattern matching)<\/h2>\n<p>  \u0418\u0442\u0430\u043a, \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0443\u043b\u0443-\u0441\u0447\u0438\u0442\u0430\u043b\u043a\u0443 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0445. \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043a\u0438\u043d\u0443\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: \u0435\u0441\u0442\u044c \u043f\u0430\u0440\u0443 \u043f\u0440\u0430\u0432\u0438\u043b \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0439 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u2014 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435, \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438 \u0442\u0434. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0443. \u0412 \u0442\u0430\u043a\u043e\u0439 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0435 \u0437\u0430\u0434\u0430\u0447\u0430 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043b\u043e\u0436\u0438\u0442\u044c\u0441\u044f \u043d\u0430 <b>switch\/case<\/b>. \u0410 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0438 switch\/case 2.0 \u0438\u043b\u0438 <b>\u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u043c (pattern matching)<\/b>.<\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0441\u043b\u043e\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c. \u041d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0442\u0430\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0432\u043e \u043a\u043e\u0434\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e \u0438 \u043f\u043b\u043e\u0445\u043e \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/ZloyChert\/DerivativeExpression\/blob\/master\/ExpressionDerivative\/PatterntMatchingDerivative.cs\">github<\/a>. \u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0439 \u0432\u044b\u0448\u043b\u043e \u0442\u0430\u043a:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">    public class PatterntMatchingDerivative     {         private readonly MethodInfo _pow = typeof(Math).GetMethod(nameof(Math.Pow));         private readonly MethodInfo _log = typeof(Math).GetMethod(nameof(Math.Log), new[] { typeof(double) });         private readonly ConstantExpression _zero = Expression.Constant(0d, typeof(double));         private readonly ConstantExpression _one = Expression.Constant(1d, typeof(double)); \t\t         public Expression&lt;Func&lt;double, double&gt;&gt; ParseDerivative(Expression&lt;Func&lt;double, double&gt;&gt; function)         {             return Expression.Lambda&lt;Func&lt;double, double&gt;&gt;(ParseDerivative(function.Body), function.Parameters);         }          private Expression ParseDerivative(Expression function) =&gt; function switch         {             BinaryExpression binaryExpr =&gt; function.NodeType switch             {                 ExpressionType.Add =&gt; Expression.Add(ParseDerivative(binaryExpr.Left), ParseDerivative(binaryExpr.Right)),                 ExpressionType.Subtract =&gt; Expression.Subtract(ParseDerivative(binaryExpr.Left), ParseDerivative(binaryExpr.Right)),                  ExpressionType.Multiply =&gt; (binaryExpr.Left, binaryExpr.Right) switch \t\t{\t \t  \t    (ConstantExpression _, ConstantExpression _) =&gt; _zero, \t\t    (ConstantExpression constant, ParameterExpression _) =&gt; constant, \t\t    (ParameterExpression _, ConstantExpression constant) =&gt; constant, \t\t    _ =&gt; Expression.Add(Expression.Multiply(ParseDerivative(binaryExpr.Left), binaryExpr.Right), Expression.Multiply(binaryExpr.Left, ParseDerivative(binaryExpr.Right))) \t\t},                  ExpressionType.Divide =&gt; (binaryExpr.Left, binaryExpr.Right) switch \t\t{ \t\t    (ConstantExpression _, ConstantExpression _) =&gt; _zero, \t\t    (ConstantExpression constant, ParameterExpression parameter) =&gt; Expression.Divide(constant, Expression.Multiply(parameter, parameter)), \t\t    (ParameterExpression _, ConstantExpression constant) =&gt; Expression.Divide(_one, constant), \t\t    _ =&gt; Expression.Divide(Expression.Subtract(Expression.Multiply(ParseDerivative(binaryExpr.Left), binaryExpr.Right), Expression.Multiply(binaryExpr.Left, ParseDerivative(binaryExpr.Right))), Expression.Multiply(binaryExpr.Right, binaryExpr.Right)) \t        },             },             MethodCallExpression methodCall when methodCall.Method == _pow =&gt; (methodCall.Arguments[0], methodCall.Arguments[1]) switch             {                 (ConstantExpression constant, ParameterExpression _) =&gt; Expression.Multiply(methodCall, Expression.Call(null, _log, constant)),                 (ParameterExpression param, ConstantExpression constant) =&gt; Expression.Multiply(constant, Expression.Call(null, _pow, param, Expression.Constant((double)constant.Value - 1, typeof(double)))),                 (ConstantExpression constant, Expression expression) =&gt; Expression.Multiply(Expression.Multiply(ParseDerivative(expression), methodCall), Expression.Call(null, _log, constant)),              },              _ =&gt; function.NodeType switch             {                 ExpressionType.Constant =&gt; _zero,                 ExpressionType.Parameter =&gt; _one,                 _ =&gt; throw new OutOfMemoryException(&quot;Bitmap best practice&quot;)              }         };     } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0435\u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e, \u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u041f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u2014 \u0432\u0441\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u043d\u043e \u043b\u043e\u0436\u0430\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0441\u0430\u043c \u0437\u0430 \u0441\u0435\u0431\u044f, \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043b\u0443\u0447\u0448\u0435 \u0438 \u043d\u0435 \u043e\u043f\u0438\u0448\u0435\u0448\u044c. <br \/>  <a name=\"nv\"><\/a>  <\/p>\n<h2>\u041d\u0430\u0438\u0432\u043d\u044b\u0439 visitor<\/h2>\n<p>  \u0412 \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u0442\u0443\u0442 \u0436\u0435 \u043d\u0430 \u0443\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e expression tree visitor, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0432\u043e\u0434\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0448\u0443\u043c\u0430 <br \/>  \u0438 \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u043f\u0430\u043d\u0438\u043a\u0438 \u0441\u0440\u0435\u0434\u0438 \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u0435\u0439 \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u0430\u0434\u0436\u0430\u0439\u043b \u043d\u0430 \u043a\u0443\u0445\u043d\u0435. \u00ab\u0411\u043e\u0439\u0441\u044f \u043d\u0438 \u043d\u0435\u0437\u043d\u0430\u043d\u0438\u044f, \u0430 \u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u043d\u0438\u044f. \u041b\u0443\u0447\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0442\u044c, \u0447\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0434\u043e\u0439 \u0442\u043e, \u0447\u0442\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0434\u0430\u00bb. \u0412\u0441\u043f\u043e\u043c\u043d\u0438\u0432 \u0441\u0438\u0435 \u0447\u0443\u0434\u043d\u0443\u044e \u0444\u0440\u0430\u0437\u0443 \u0422\u043e\u043b\u0441\u0442\u043e\u0433\u043e, \u043f\u0440\u0438\u0437\u043d\u0430\u0432 \u043d\u0435\u0437\u043d\u0430\u043d\u0438\u0435 \u0438 \u0437\u0430\u0440\u0443\u0447\u0438\u0432\u0448\u0438\u0441\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0433\u0443\u0433\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/csharp\/expression-trees-interpreting\">\u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e<\/a>.<\/p>\n<p>  \u0423 \u043c\u0435\u043d\u044f \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u043e\u0439 (\u043f\u043e\u0441\u043b\u0435 \u0421\u0438\u0431\u0438\u0440\u0438 \u0432 1949) \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u00abExpression tree visitor\u00bb.<br \/>  \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u0434\u043e. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0430 \u043a\u043b\u0430\u0441\u0441\u044b \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u0441\u0443\u0444\u0444\u0438\u043a\u0441\u043e\u043c <i>Visitor<\/i>. <\/p>\n<p>  \u041e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0432\u0448\u0438\u0441\u044c \u0441\u043e \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0438 \u0441\u0434\u0435\u043b\u0430\u0432 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<br \/>  <a href=\"https:\/\/github.com\/ZloyChert\/DerivativeExpression\/blob\/master\/ExpressionDerivative\/CustomExpressionTreeVisitor.cs\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 github<\/a>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public class CustomDerivativeExpressionTreeVisitor     {         public Expression&lt;Func&lt;double, double&gt;&gt; Visit(Expression&lt;Func&lt;double, double&gt;&gt; function)         {             return Expression.Lambda&lt;Func&lt;double, double&gt;&gt;(Visitor.CreateFromExpression(function.Body).Visit(), function.Parameters);         }     }      public abstract class Visitor     {         protected static readonly MethodInfo Pow = typeof(Math).GetMethod(nameof(Math.Pow));         protected static readonly MethodInfo Log = typeof(Math).GetMethod(nameof(Math.Log), new[] { typeof(double) });         protected readonly ConstantExpression Zero = Expression.Constant(0d, typeof(double));         protected readonly ConstantExpression One = Expression.Constant(1d, typeof(double));         public abstract Expression Visit();         public static Visitor CreateFromExpression(Expression node)             =&gt; node switch             {                 BinaryExpression be =&gt; new BinaryVisitor(be),                 MethodCallExpression mce when mce.Method == Pow =&gt; new PowMethodCallVisitor(mce),                 _ =&gt; new SimpleVisitor(node),             };              }      public class BinaryVisitor : Visitor     {         private readonly BinaryExpression _node;                  public BinaryVisitor(BinaryExpression node)         {             _node = node;         }          public override Expression Visit()             =&gt; _node.NodeType switch             {                 ExpressionType.Add =&gt; Expression.Add(ParseDerivative(binaryExpr.Left), ParseDerivative(binaryExpr.Right)),                 ExpressionType.Subtract =&gt; Expression.Subtract(ParseDerivative(binaryExpr.Left), ParseDerivative(binaryExpr.Right)),                  ExpressionType.Multiply =&gt; (binaryExpr.Left, binaryExpr.Right) switch \t\t{\t \t  \t    (ConstantExpression _, ConstantExpression _) =&gt; _zero, \t\t    (ConstantExpression constant, ParameterExpression _) =&gt; constant, \t\t    (ParameterExpression _, ConstantExpression constant) =&gt; constant, \t\t    _ =&gt; Expression.Add(Expression.Multiply(ParseDerivative(binaryExpr.Left), binaryExpr.Right), Expression.Multiply(binaryExpr.Left, ParseDerivative(binaryExpr.Right))) \t\t},                  ExpressionType.Divide =&gt; (binaryExpr.Left, binaryExpr.Right) switch \t\t{ \t\t    (ConstantExpression _, ConstantExpression _) =&gt; _zero, \t\t    (ConstantExpression constant, ParameterExpression parameter) =&gt; Expression.Divide(constant, Expression.Multiply(parameter, parameter)), \t\t    (ParameterExpression _, ConstantExpression constant) =&gt; Expression.Divide(_one, constant), \t\t    _ =&gt; Expression.Divide(Expression.Subtract(Expression.Multiply(ParseDerivative(binaryExpr.Left), binaryExpr.Right), Expression.Multiply(binaryExpr.Left, ParseDerivative(binaryExpr.Right))), Expression.Multiply(binaryExpr.Right, binaryExpr.Right)) \t        },             };     }      public class PowMethodCallVisitor : Visitor     {         private readonly MethodCallExpression _node;          public PowMethodCallVisitor(MethodCallExpression node)         {             _node = node;         }          public override Expression Visit()             =&gt; (_node.Arguments[0], _node.Arguments[1]) switch             {                 (ConstantExpression constant, ParameterExpression _) =&gt; Expression.Multiply(_node, Expression.Call(null, Log, constant)),                 (ParameterExpression param, ConstantExpression constant) =&gt; Expression.Multiply(constant, Expression.Call(null, Pow, param, Expression.Constant((double)constant.Value - 1, typeof(double)))),                 (ConstantExpression constant, Expression expression) =&gt; Expression.Multiply(Expression.Multiply(CreateFromExpression(expression).Visit(), _node), Expression.Call(null, Log, constant)),             };     }      public class SimpleVisitor : Visitor     {         private readonly Expression _node;          public SimpleVisitor(Expression node)         {             _node = node;         }          public override Expression Visit()             =&gt; _node.NodeType switch             {                 ExpressionType.Constant =&gt; Zero,                 ExpressionType.Parameter =&gt; One,             };     } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e \u0441\u0443\u0442\u0438 \u2014 \u043c\u044b \u0440\u0430\u0437\u043c\u0430\u0437\u0430\u043b\u0438 \u0441\u0432\u0438\u0442\u0447 \u043a\u0435\u0439\u0441\u044b \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u0430\u043c. \u041c\u0435\u043d\u044c\u0448\u0435 \u0438\u0445 \u043d\u0435 \u0441\u0442\u0430\u043b\u043e, \u043c\u0430\u0433\u0438\u0438 \u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c. \u0412\u0441\u0435 \u0442\u0435 \u0436\u0435 \u043a\u0435\u0439\u0441\u044b, \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u0442\u0440\u043e\u043a. \u0410 \u0433\u0434\u0435 \u0436\u0435 \u043e\u0431\u0435\u0449\u0430\u043d\u043d\u0430\u044f \u0434\u0432\u043e\u0439\u043d\u0430\u044f double dispatch \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f?<br \/>  <a name=\"cv\"><\/a>  <\/p>\n<h2>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 visitor \u0438 \u0434\u0432\u043e\u0439\u043d\u0430\u044f \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0443\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u0441\u0430\u043c \u0448\u0430\u0431\u043b\u043e\u043d &quot;<b>\u041f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u044c<\/b>&quot;, \u043e\u043d \u0436\u0435 <b>Visitor<\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432 \u043e\u0441\u043d\u043e\u0432\u0443 <i>Expression tree visitor<\/i>&#8216;\u0430. \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0435\u0433\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. <\/p>\n<p>  \u041d\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u041c\u044b \u0445\u043e\u0442\u0438\u043c \u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0434\u0435\u0440\u0435\u0432\u0443 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u043e\u0432 \u0443\u0437\u043b\u043e\u0432 (\u0442\u0438\u043f\u043e\u0432 Expression&#8217;\u0430) \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. <\/p>\n<p>  <b>\u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/b> \u2014 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c. \u0422\u043e \u0435\u0441\u0442\u044c \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c switch\/case. \u042d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u0438 \u043f\u043b\u043e\u0445\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u041d\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u043d\u044e\u0430\u043d\u0441: \u043c\u044b \u0440\u0430\u0437\u043c\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043b\u043e\u0433\u0438\u043a\u0443, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0443\u044e \u0437\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u0438\u043f. \u0413\u043e\u0432\u043e\u0440\u044f \u043f\u0440\u043e\u0449\u0435, \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c \u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b (<i>\u0430\u043a\u0430 \u043f\u043e\u0437\u0434\u043d\u0435\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435<\/i>) \u0434\u0430\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043b\u043e\u0436\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u043d\u0430 \u0441\u0440\u0435\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u044d\u0442\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430. \u041d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u0434\u0430\u043b\u0435\u0435 \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0441\u0440\u0435\u0434\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430 \u043d\u0430\u0441.<\/p>\n<p>  <b>\u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442.<\/b> \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043b\u043e\u0433\u0438\u043a\u0443 \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b. \u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0431\u044b\u0442\u044c \u043e switch\/case. \u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0440\u0435\u0448\u0438\u0442 \u0437\u0430 \u043d\u0430\u0441. \u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043c\u0435\u0442\u043e\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044e \u0432 \u043d\u0435\u0439. \u041d\u043e \u044d\u0442\u043e \u0442\u0435\u043c\u0430 \u043d\u0430 \u0446\u0435\u043b\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u044c\u0441\u044f. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0435\u0448\u0430\u044e\u0442 \u043d\u0430\u0448\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u041d\u043e \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043e\u043d\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u0434\u0440\u0443\u0433\u0443\u044e. \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 GetDeriviative(). \u041d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0441\u0442\u0440\u0430\u043d\u043d\u043e. \u041c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043d\u0430 \u0432\u0441\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0436\u0438\u0437\u043d\u0438, \u043d\u043e \u043e\u043d\u0438 \u043d\u0435 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0434 \u043e\u0431\u0449\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043a\u043b\u0430\u0441\u0441\u0430. \u0414\u0430 \u0438 \u043c\u044b \u0442\u0430\u043a \u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c (\u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0435\u043c, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f). \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430\u043c). <\/p>\n<p>  \u041e\u0434\u043d\u0438\u043c\u0438 \u043b\u0438\u0448\u044c \u0443\u0441\u0438\u043b\u0438\u044f\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0435 \u0443\u0434\u0430\u0441\u0442\u0441\u044f.<\/p>\n<p>  \u0412\u043e\u0442 \u0442\u0443\u0442 \u0438 \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0432\u0438\u0437\u0438\u0442\u043e\u0440. \u0412 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u0442\u0438\u043f\u0435 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 (Expression \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435) \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u0432\u0438\u0434\u0430<\/p>\n<pre><code class=\"cs\">virtual Expression Accept(ExpressionVisitor visitor);<\/code><\/pre>\n<p>  \u0412 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d. <\/p>\n<p>  \u0421\u0430\u043c ExpressionVisitor \u2014 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043f\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 \u0441 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u043e\u0439<br \/>  \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0438\u043f \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438. \u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 ExpressionVisitor \u2014 VisitBinary(&#8230;), VisitMethodCall(&#8230;), VisitConstant(&#8230;), VisitParameter(&#8230;).<\/p>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u043d\u0430\u0448\u0435\u0439 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438. <\/p>\n<p>  \u0422.\u0435. \u043c\u0435\u0442\u043e\u0434 Accept \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 BinaryExpression \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">\t protected internal override Expression Accept(ExpressionVisitor visitor) {         return visitor.VisitBinary(this); } <\/code><\/pre>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043b\u0438\u0448\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 ExpressionVisitor, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f DerivativeExpressionVisitor.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043d\u0435\u043a\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u0432 Expression, \u043d\u043e \u043a\u0430\u043a\u0438\u0445 \u2014 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043d\u043e \u0438 \u043d\u0435 \u043d\u0430\u0434\u043e.<br \/>  \u041c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 Accept \u0441 \u043d\u0443\u0436\u043d\u043e\u0439 \u043d\u0430\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 ExpressionVisitor, \u0442.\u0435. \u0441 DerivativeExpressionVisitor. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Accept \u0442\u0438\u043f\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0441\u043a\u0430\u0436\u0435\u043c BinaryExpression. \u0412 \u0442\u0435\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043c\u044b \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u0432 BinaryExpression, \u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a\u043e\u0439 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a ExpressionVisitor \u043a \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u0435\u043b. \u041d\u043e \u0442.\u043a. VisitBinary \u0442\u0430\u043a\u0436\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439, \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c. \u041e\u043f\u044f\u0442\u044c \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0432\u044b\u0437\u043e\u0432 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 (\u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f) \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f VisitBinary \u0442\u0438\u043f\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0412\u043e\u0442 \u0432\u0430\u043c \u0438 \u0434\u0432\u043e\u0439\u043d\u0430\u044f \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u2014 \u043f\u0438\u043d\u0433-\u043f\u043e\u043d\u0433 \u0432 \u0441\u0442\u0438\u043b\u0435 \u00ab\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0439\u00bb \u2014 \u00ab\u043d\u0435\u0442, \u0442\u044b\u00bb. <\/p>\n<p>  \u0427\u0442\u043e \u043d\u0430\u043c \u044d\u0442\u043e \u0434\u0430\u0435\u0442. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u044d\u0442\u043e \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u00ab\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u00bb \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u0437\u0432\u043d\u0435, \u043d\u0435 <br \/>  \u0438\u0437\u043c\u0435\u043d\u044f\u044f \u043a\u043b\u0430\u0441\u0441\u0430. \u0417\u0432\u0443\u0447\u0438\u0442 \u0437\u0434\u043e\u0440\u043e\u0432\u043e, \u043d\u043e \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b:<\/p>\n<ol>\n<li>\u041a\u0430\u043a\u043e\u0439-\u0442\u043e \u043b\u0435\u0432\u0430\u043a \u0432 \u0432\u0438\u0434\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 Accept, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0432\u0441\u0435 \u0438 \u043d\u0438 \u0437\u0430 \u0447\u0442\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e<\/li>\n<li>\u0412\u043e\u043b\u043d\u043e\u0432\u043e\u0439 \u044d\u0444\u0444\u0435\u043a\u0442 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 \u0432 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u0432 \u0445\u0443\u0434\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0441\u0435\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u043e\u0434\u0435\u043b\u044b\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0432\u0438\u0437\u0438\u0442\u043e\u0440\u044b<\/li>\n<\/ol>\n<p>  \u041d\u043e \u043f\u0440\u0438\u0440\u043e\u0434\u0430 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u0434\u0435\u0440\u0436\u043a\u0438 \u0438\u0437-\u0437\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u0432\u0435\u0434\u044c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u043e\u0431\u0445\u043e\u0434\u044b \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439.<br \/>  <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.linq.expressions.expressionvisitor?view=netstandard-2.1\">\u0417\u0434\u0435\u0441\u044c<\/a> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438. <\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0432 \u0438\u0442\u043e\u0433\u0435 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442.<br \/>  <a href=\"https:\/\/github.com\/ZloyChert\/DerivativeExpression\/blob\/master\/ExpressionDerivative\/BuildinExpressionTreeVisitor.cs\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 github.<\/a><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public class BuildinExpressionTreeVisitor : ExpressionVisitor     {         private readonly MethodInfo _pow = typeof(Math).GetMethod(nameof(Math.Pow));         private readonly MethodInfo _log = typeof(Math).GetMethod(nameof(Math.Log), new[] { typeof(double) });         private readonly ConstantExpression _zero = Expression.Constant(0d, typeof(double));         private readonly ConstantExpression _one = Expression.Constant(1d, typeof(double));          public Expression&lt;Func&lt;double, double&gt;&gt; GetDerivative(Expression&lt;Func&lt;double, double&gt;&gt; function)         {             return Expression.Lambda&lt;Func&lt;double, double&gt;&gt;(Visit(function.Body), function.Parameters);         }          protected override Expression VisitBinary(BinaryExpression binaryExpr)             =&gt; binaryExpr.NodeType switch             {                 ExpressionType.Add =&gt; Expression.Add(Visit(binaryExpr.Left), Visit(binaryExpr.Right)),                 ExpressionType.Subtract =&gt; Expression.Subtract(Visit(binaryExpr.Left), Visit(binaryExpr.Right)),                  ExpressionType.Multiply when binaryExpr.Left is ConstantExpression &amp;&amp; binaryExpr.Right is ConstantExpression =&gt; _zero,                 ExpressionType.Multiply when binaryExpr.Left is ConstantExpression &amp;&amp; binaryExpr.Right is ParameterExpression =&gt; binaryExpr.Left,                 ExpressionType.Multiply when binaryExpr.Left is ParameterExpression &amp;&amp; binaryExpr.Right is ConstantExpression =&gt; binaryExpr.Right,                 ExpressionType.Multiply =&gt; Expression.Add(Expression.Multiply(Visit(binaryExpr.Left), binaryExpr.Right), Expression.Multiply(binaryExpr.Left, Visit(binaryExpr.Right))),                  ExpressionType.Divide when binaryExpr.Left is ConstantExpression &amp;&amp; binaryExpr.Right is ConstantExpression =&gt; _zero,                 ExpressionType.Divide when binaryExpr.Left is ConstantExpression &amp;&amp; binaryExpr.Right is ParameterExpression =&gt; Expression.Divide(binaryExpr.Left, Expression.Multiply(binaryExpr.Right, binaryExpr.Right)),                 ExpressionType.Divide when binaryExpr.Left is ParameterExpression &amp;&amp; binaryExpr.Right is ConstantExpression =&gt; Expression.Divide(_one, binaryExpr.Right),                 ExpressionType.Divide =&gt; Expression.Divide(Expression.Subtract(Expression.Multiply(Visit(binaryExpr.Left), binaryExpr.Right), Expression.Multiply(binaryExpr.Left, Visit(binaryExpr.Right))), Expression.Multiply(binaryExpr.Right, binaryExpr.Right)),             };          protected override Expression VisitMethodCall(MethodCallExpression methodCall)             =&gt; (methodCall.Arguments[0], methodCall.Arguments[1]) switch             {                 (ConstantExpression constant, ParameterExpression _) =&gt; Expression.Multiply(methodCall, Expression.Call(null, _log, constant)),                 (ParameterExpression param, ConstantExpression constant) =&gt; Expression.Multiply(constant, Expression.Call(null, _pow, param, Expression.Constant((double)constant.Value - 1, typeof(double)))),                 (ConstantExpression constant, Expression expression) =&gt; Expression.Multiply(Expression.Multiply(Visit(expression), methodCall), Expression.Call(null, _log, constant)),             };          protected override Expression VisitConstant(ConstantExpression _) =&gt; _zero;          protected override Expression VisitParameter(ParameterExpression b) =&gt; _one;     } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h2>\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<p>  \u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u043a\u0430\u043a \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0437\u0430\u0434\u0430\u0447 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0434\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f. \u0412\u0441\u0435, \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438. \u041c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043c\u0430\u0442\u0447\u0438\u043d\u0433 \u0434\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0442.\u043a. \u044f \u0435\u0433\u043e \u043d\u0435 \u0440\u0430\u0437\u0432\u0438\u043b \u0434\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043e\u0432 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0431\u044b \u0434\u0430\u043d\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u0435\u0441\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u043b\u043e\u0441\u044c, \u0441\u0442\u043e\u0438\u043b\u043e \u0431\u044b \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f \u043e \u0432\u0438\u0437\u0438\u0442\u043e\u0440\u0435. \u0418 \u0434\u0430\u0436\u0435 \u043d\u0430\u0438\u0432\u043d\u044b\u0439 \u0432\u0438\u0437\u0438\u0442\u043e\u0440 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u0436\u0438\u0437\u043d\u044c \u2014 \u0432\u0435\u0434\u044c \u044d\u0442\u043e \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0441\u043a\u0438\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430 \u043f\u043e \u043a\u043b\u0430\u0441\u0441\u0430\u043c, \u0435\u0441\u043b\u0438 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b. \u0418 \u0434\u0430\u0436\u0435 \u0442\u0443\u0442 \u0431\u044b\u0432\u0430\u044e\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0422\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438 \u0441\u0430\u043c\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0432\u0438\u0437\u0438\u0442\u043e\u0440\u0430 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u2014 \u043e\u0447\u0435\u043d\u044c \u0441\u043f\u043e\u0440\u043d\u0430\u044f \u0432\u0435\u0449\u044c.<\/p>\n<p>  \u041d\u043e \u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u0434\u0435\u0441\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0445\u0432\u0430\u0442\u0438\u0442, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440.<\/p><\/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=\"https:\/\/habr.com\/ru\/post\/486972\/\"> https:\/\/habr.com\/ru\/post\/486972\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/486972\/\">\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a. \u0414\u0435\u0440\u0435\u0432\u044c\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u0441 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u043c Visitor, \u0432\u0441\u0435\u0433\u0434\u0430 \u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u043e\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435, \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u0442\u0435\u043c \u043b\u0435\u0433\u0447\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u043c\u0441\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0447\u0442\u043e-\u0442\u043e, \u0447\u0442\u043e \u0438\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u043e.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xt\/6c\/bf\/xt6cbf1-gfkv4-64zs250n_-7pa.jpeg\">  <\/p>\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-298508","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/298508","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=298508"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/298508\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=298508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=298508"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=298508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}