{"id":340060,"date":"2022-10-21T15:00:15","date_gmt":"2022-10-21T15:00:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=340060"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=340060","title":{"rendered":"<span>\u041e\u0431\u0437\u043e\u0440 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u0432 C# 11<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>C# 11 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0443\u0436\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0441\u043a\u043e\u0440\u043e, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0440\u0430 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0432 \u044f\u0437\u044b\u043a\u0435. \u0418 \u0445\u043e\u0442\u044f \u0438\u0445 \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435: \u043e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u0430\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430, \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 required, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0442\u0438\u043f\u0430 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b96\/a11\/5af\/b96a115af62368ac62c251d566c224f7.png\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b96\/a11\/5af\/b96a115af62368ac62c251d566c224f7.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u041e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043f\u043e\u0447\u0442\u0438 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438. \u0425\u043e\u0442\u044c \u043c\u044b \u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u043c\u043e\u0433\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0442\u0438\u043f \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430, \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0442\u0438\u043f\u044b \u043f\u043e\u0434\u043b\u0435\u0436\u0430\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0447\u0435\u0440\u0435\u0437 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u0435\u043b\u044c \u0442\u0438\u043f\u0430 <em>where<\/em>. \u0410 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>typeof<\/em>.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 &#171;<a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%B5%D0%BA%D0%BE%D1%80%D0%B0%D1%82%D0%BE%D1%80_(%D1%88%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD_%D0%BF%D1%80%D0%BE%D0%B5%D0%BA%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F)\">\u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440<\/a>&#171;. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0441\u0430\u043c \u043e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442:<\/p>\n<pre><code class=\"cs\">[AttributeUsage(AttributeTargets.Class)] public class DecorateAttribute&lt;T> : Attribute where T : class {     public Type DecoratorType{ get; set; }     public DecorateAttribute()     {         DecoratorType = typeof(T);     } } <\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043a\u0430\u043a \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u043c, \u0442\u0430\u043a \u0438 \u0444\u0430\u0431\u0440\u0438\u043a\u0443 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u0435\u043a\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u043d\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <em>Decorate<\/em>:<\/p>\n<pre><code class=\"cs\">public interface IWorker {     public void Action(); } public class LoggerDecorator : IWorker {     private IWorker _worker;     public LoggerDecorator(IWorker worker)     {         _worker = worker;     }     public void Action()     {         Console.WriteLine(\"Log before\");         _worker.Action();         Console.WriteLine(\"Log after\");     } } [Decorate&lt;LoggerDecorator>] public class SimpleWorker : IWorker {     public void Action()     {         Console.WriteLine(\"Working..\");     } }  public static class WorkerFactory {     public static IWorker CreateWorker()     {         IWorker worker = new SimpleWorker();          if (typeof(SimpleWorker)             .GetCustomAttribute&lt;DecorateAttribute&lt;LoggerDecorator>>() != null)         {             worker = new LoggerDecorator(worker);         }          return worker;     } } <\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<pre><code class=\"cs\">var worker = WorkerFactory.CreateWorker();  worker.Action(); \/\/ Log before \/\/ Working.. \/\/ Log after <\/code><\/pre>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0441\u043d\u044f\u0442\u044b \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u2013 \u0442\u0438\u043f \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044f\u0432\u043d\u043e. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0442\u0438\u043f\u0430 \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f:<\/p>\n<pre><code class=\"cs\">public class GenericAttribute&lt;T> : Attribute { } public class GenericClass&lt;T> {     [GenericAttribute&lt;T>]     \/\/Error CS8968 'T': an attribute type argument cannot use type parameters     public void Action()     {         \/\/ ....     } } <\/code><\/pre>\n<p>\u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441: <em>GenericAttribute&lt;int><\/em> \u0438 <em>GenericAttribute&lt;string><\/em> \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043e\u0434\u043d\u043e\u0433\u043e? \u0412 Microsoft \u0440\u0435\u0448\u0438\u043b\u0438, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435. \u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0442\u0435\u043a\u0430\u0435\u0442, \u0447\u0442\u043e \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <em>AllowMultiple<\/em> \u0432 <em>true<\/em>. \u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cs\">[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] public class DecorateAttribute&lt;T> : Attribute where T : class {     \/\/ .... } <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043a\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437:<\/p>\n<pre><code class=\"cs\">[Decorate&lt;LoggerDecorator>] [Decorate&lt;TimerDecorator>] public class SimpleWorker : IWorker {     \/\/ .... } <\/code><\/pre>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0438\u0447\u0435\u0433\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u0440\u0438\u0432\u043d\u0435\u0441\u043b\u043e, \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445.<\/p>\n<h3>\u041e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u0430\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430<\/h3>\n<p>\u0421 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044f\u0437\u044b\u043a\u0430 \u043d\u0430\u043c \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 \u043e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u0434\u0432\u0443\u0445 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u0445 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 (\u0438\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e) \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <em>abstract<\/em>, \u043e\u0431\u044f\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434;<\/p>\n<\/li>\n<li>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u0445 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0432\u0438\u0434\u0430 <em>static abstract<\/em>, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u043c, \u043d\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043b\u0438\u0448\u0435\u043d\u043d\u044b\u043c \u0441\u043c\u044b\u0441\u043b\u0430 \u044f \u0431\u044b \u044d\u0442\u043e \u043d\u0435 \u043d\u0430\u0437\u0432\u0430\u043b. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0434\u0435\u043b\u0435, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"cs\">public interface IAddable&lt;TLeft, TRight, TResult>     where TLeft : IAddable&lt;TLeft, TRight, TResult> {     static abstract TResult operator +(TLeft left, TRight right); } public interface IParsable&lt;T> where T : IParsable&lt;T> {     static abstract T Parse(string s); } public record Natural : IAddable&lt;Natural, Natural, Natural>, IParsable&lt;Natural> {     public int Value { get; init; } = 0;     public static Natural Parse(string s)     {         return new() { Value = int.Parse(s) };     }     public static Natural operator +(Natural left, Natural right)     {         return new() { Value = left.Value + right.Value };     } } <\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0432 \u0434\u0435\u043b\u0435 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">var one = new Natural { Value = 1 }; var two = new Natural { Value = 2 }; var three = one + two; Console.WriteLine(three); \/\/ Natural { Value = 3 }  var parsed = Natural.Parse(\"42\"); Console.WriteLine(parsed); \/\/ Natural { Value = 42 } <\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Curiously_recurring_template_pattern\">\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430<\/a> \u0432\u0438\u0434\u0430 <em>Natural: IParsable&lt;Natural><\/em>. \u0421 \u043d\u0438\u043c \u043d\u0430\u0434\u043e \u0431\u044b\u0442\u044c \u043f\u043e\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0442\u0438\u043f\u0430 \u2014<em>Natural : IParsable&lt;OtherParsableType><\/em>.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043d\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0442\u0438\u043f\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0430 \u0442\u0430\u043a\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<\/p>\n<pre><code class=\"cs\">public IEnumerable&lt;T> ParseCsvRow&lt;T>(string content) where T : IParsable&lt;T>     => content.Split(',').Select(T.Parse); \/\/ .... var row = ParseCsvRow&lt;Natural>(\"1,5,2\"); Console.WriteLine(string.Join(' ', row.Select(x => x.Value))); \/\/ 1 5 2 <\/code><\/pre>\n<p>\u0420\u0430\u043d\u044c\u0448\u0435 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0442\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u044b\u043b\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u2013 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0438\u043f. \u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043b\u044e\u0431\u044b\u043c \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u043c <em>IParsable<\/em>.<\/p>\n<p>\u0417\u0430\u0434\u0430\u043d\u0438\u0435\u043c \u0441\u0432\u043e\u0435\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0434\u0435\u043b\u043e \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0411\u044b\u043b \u0438\u0437\u043c\u0435\u043d\u0451\u043d \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0442\u0438\u043f\u043e\u0432: 20 \u0438\u0437 \u043d\u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/standard\/generics\/math\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/p>\n<p>\u0413\u043b\u0430\u0432\u043d\u044b\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <em>INumber<\/em> \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">static T Sum&lt;T>(IEnumerable&lt;T> values)     where T : INumber&lt;T> {     T result = T.Zero;     foreach (var value in values)     {         result += T.CreateChecked(value);     }     return result; } <\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u0441 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u043c\u0438, \u0442\u0430\u043a \u0438 \u0441 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438:<\/p>\n<pre><code class=\"cs\">Console.WriteLine(Sum(new int[] { 1, 2, 3, 4, 5 })); \/\/ 15  Console.WriteLine(Sum(new double[] { 0.5, 2.5, 3.0, 4.3, 3.2 })); \/\/ 13.5 <\/code><\/pre>\n<p>\u0418 \u044d\u0442\u043e \u043d\u0435 \u0432\u0441\u0451. \u0422\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0431\u0438\u0442\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430, \u043d\u043e \u0432\u0441\u044f \u044d\u0442\u0430 \u0442\u0435\u043c\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c \u0434\u043e\u0441\u0442\u043e\u0439\u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u0430 \u043f\u043e\u043a\u0430 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u044e \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u0432 <a href=\"https:\/\/learn.microsoft.com\/dotnet\/standard\/generics\/math\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/a>.<\/p>\n<p>\u042f \u0436\u0435 \u043f\u043e\u0434\u0432\u0435\u0434\u0443 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438\u0442\u043e\u0433\u0438. \u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u0438\u043c, \u0432\u0435\u0434\u044c \u043d\u0435 \u0432\u0441\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438. \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <em>static abstract<\/em> \u0442\u0430\u043a\u0436\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u0430 \u0447\u0442\u043e\u0431\u044b \u0431\u0440\u043e\u0441\u0430\u0442\u044c\u0441\u044f \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u0435\u0451 \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u0436\u0438\u0437\u043d\u044c \u043b\u0443\u0447\u0448\u0435 \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u043e \u2013 \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0441\u043c\u043e\u0433\u0443\u0442 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0431\u0435\u0441\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043e\u043a.<\/p>\n<h3>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044b<\/h3>\n<p>\u0412 C# \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c &#171;\u0441\u044b\u0440\u044b\u0435&#187; \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e (\u043e\u0442 \u0442\u0440\u0451\u0445) \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u0430\u0432\u044b\u0447\u0435\u043a. \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 @, \u043d\u043e \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0432\u0430\u0436\u043d\u044b\u0445 \u043e\u0442\u043b\u0438\u0447\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0438 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a \u0432\u0441\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b, \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u043c \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u043c, \u0431\u0443\u0434\u0443\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u044b \u0438\u0437 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0432\u044b\u0447\u043a\u0438 (\u0438 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 \u043f\u0440\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438).<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u043e\u0437\u044c\u043c\u0451\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 json \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cs\">string GetJsonForecast(DateTime date, int temperature, string summary)     => $$\"\"\"     {         \"Date\": \"{{date.ToString(\"yyyy-MM-dd\")}}\",          \"TemperatureCelsius\": \"{{temperature}}\",         \"Summary\": \"{{summary}}\",         \"Note\": \"\"     }     \"\"\"; <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0432\u0438\u0434\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e json:<\/p>\n<pre><code class=\"cs\">{     \"Date\": \"2022-09-16\",     \"TemperatureCelsius\": 10,     \"Summary\": \"Windy\",     \"Note\": \"\" } <\/code><\/pre>\n<p>\u041e\u0442\u043b\u0438\u0447\u0438\u044f \u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 @ \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e: \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u043b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u043b \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u044f\u0442 &#171;\u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e&#187; \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u043c\u0438 \u0438 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u043c\u0438 \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438, \u0430 \u043b\u0438\u0448\u043d\u0438\u0445 \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 \u0441\u043b\u0435\u0432\u0430 \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442. \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 &#171;\u0441\u044b\u0440\u044b\u043c\u0438&#187; \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0442\u0430\u043a\u0438\u0435:<\/p>\n<ul>\n<li>\n<p>\u0421\u0442\u0440\u043e\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0441 3-\u0445 \u0438 \u0431\u043e\u043b\u0435\u0435 \u043a\u0430\u0432\u044b\u0447\u0435\u043a. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u0435 3 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u043f\u043e\u0434\u0440\u044f\u0434, \u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0443\u0436\u043d\u043e 4 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0435\u0439, \u043d\u043e \u0443\u0436\u0435 \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430. \u0422\u0430\u043a, \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0434\u0432\u0430 \u0437\u043d\u0430\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b json;<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0439. \u0422\u043e\u0433\u0434\u0430 \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u0441\u0438\u043c\u0432\u043e\u043b \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0439. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 (\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 \u043d\u0438\u0445 \u0442\u0435\u043a\u0441\u0442 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442\u0441\u044f), \u0430 \u043e\u0442\u0441\u0442\u0443\u043f \u0443 \u0442\u0435\u043a\u0441\u0442\u0430 \u043e\u0442 \u043a\u0440\u0430\u044f \u044d\u043a\u0440\u0430\u043d\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0443 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u043a\u0430\u0432\u044b\u0447\u0435\u043a.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a \u043d\u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044b, \u043d\u0435 \u0431\u043e\u044f\u0441\u044c \u043d\u0438 \u0437\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0439\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0438, \u043d\u0438 \u0437\u0430 \u043e\u043f\u0440\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430. \u041d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e: \u0437\u0430\u0447\u0435\u043c \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0431\u043e\u043b\u0435\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430?<\/p>\n<h3>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u0440\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438<\/h3>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u043e, \u043d\u0430 \u0441\u0435\u0439 \u0440\u0430\u0437 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435, \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438: \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443:<\/p>\n<pre><code class=\"cs\">Console.WriteLine(     $\"Roles in {department.Name} department are: {         string.Join(\", \", department.Employees                                     .Where(x => x.Active)                                     .Select(x => x.Role)                                     .OrderBy(x => x)                                     .Distinct())}\");  \/\/ Roles in Security department are: Administrator, Manager, PowerUser <\/code><\/pre>\n<p>\u041f\u0440\u0438\u044f\u0442\u043d\u0430\u044f \u043c\u0435\u043b\u043e\u0447\u044c, \u0435\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u0431\u044b\u043b\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c \u0434\u043b\u0438\u043d\u043d\u0443\u044e \u0446\u0435\u043f\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 (\u0432\u0440\u043e\u0434\u0435 Linq) \u0432\u043d\u0443\u0442\u0440\u044c \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438. \u0425\u043e\u0442\u044f \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430\u043c\u0438 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442, \u0443\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0431\u0435\u0441\u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0442\u043e\u0436\u0435 \u0441\u0442\u0430\u043b\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435:<\/p>\n<pre><code class=\"cs\">Console.WriteLine(     $\"Employee count is {         department.Employees                   .Where(x => x.Active)                   .Count()} in the {department.Name} department\");  \/\/ Employee count is 20 in the Security department <\/code><\/pre>\n<h3>\u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 required<\/h3>\n<p>\u0421 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c <em>required<\/em> \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u044f\u0437\u0430\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0438\u043b\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430. \u041c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0443 \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u0432\u0435.<\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044f\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u043a\u043e\u043f\u0438\u0442\u044c\u0441\u044f boilerplate \u043a\u043e\u0434, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b. \u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0444\u0438\u0433\u0443\u0440\u0430\u043c\u0438:<\/p>\n<pre><code class=\"cs\">class Point {     public int X { get; }     public int Y { get; }     public Point(int x, int y)      {          X = x;         Y = y;     } } \/\/ .... class Textbox : Rectangle {     public string Text { get; }     public Textbox(int x, int y, int width, int height, string text)          : base(x, y, width, height)     {         Text = text;     } } <\/code><\/pre>\n<p>\u0414\u043b\u044f \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u0441\u0442\u0443\u043f\u0435\u043d\u0438 \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u044b, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443: \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u043e\u0441\u044c \u0431\u043e\u043b\u0435\u0435, \u0447\u0435\u043c \u0432\u0434\u0432\u043e\u0435. \u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u044b\u0439, \u043d\u043e \u0432 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u044b\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0435\u043b \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u044c \u0435\u0449\u0451 \u0445\u0443\u0436\u0435 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u0443\u0441\u0443\u0433\u0443\u0431\u043b\u0435\u043d\u043e \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c).<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c <em>X<\/em> \u0438 <em>Y<\/em> \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <em>required<\/em>, \u0442\u043e \u044d\u0442\u043e \u0441\u043c\u0435\u0441\u0442\u0438\u0442 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u043f\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0442\u0438\u043f\u0430 \u043d\u0430 \u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cs\">class Point {     public required int X { get; set; }     public required int Y { get; set; } } \/\/ .... class Textbox : Rectangle {     public required string Text { get; set; } } <\/code><\/pre>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0435\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0444\u0430\u043a\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u0438\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442:<\/p>\n<pre><code class=\"cs\">var textbox = new Textbox() { Text = \"button\" }; \/\/ Error CS9035: Required member 'Point.X' be set in the object initializer \/\/ or attribute constructor \/\/ Error CS9035: Required member 'Point.Y' must be set in the object initializer \/\/ or attribute constructor \/\/ .... <\/code><\/pre>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 ORM, \u043e\u0431\u044f\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0438\u043c\u0435\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0432\u0435\u0434\u044c, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0440\u0430\u043d\u044c\u0448\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u044b\u043b\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0435 \u0441 Id.<\/p>\n<p>\u0412\u0441\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/learn.microsoft.com\/dotnet\/csharp\/language-reference\/keywords\/required\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>, \u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435:<\/p>\n<ul>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c <em>SetsRequiredMembers<\/em>, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u044f, \u0447\u0442\u043e \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0447\u043b\u0435\u043d\u044b \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043d\u0451\u043c \u2013 \u0442\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e;<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439, \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0439 \u0442\u0430\u043a\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c (\u0447\u0435\u0440\u0435\u0437 <em>this()<\/em> \u0438\u043b\u0438 <em>base()<\/em>), \u0442\u043e \u043e\u043d \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u0441\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430, \u0435\u0451 \u0432\u0441\u0451 \u0435\u0449\u0451 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438, \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0432 <em>null<\/em>;<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u044b. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u0440\u0435\u0434\u0432\u0438\u0436\u0443, \u0447\u0442\u043e \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0441\u0431\u0438\u0432\u0430\u0442\u044c \u0441 \u0442\u043e\u043b\u043a\u0443 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 <em>required<\/em>, \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <em>Required<\/em>, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u043e\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <em>SetsRequiredMembers<\/em> \u0434\u043b\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e \u043e\u0441\u0442\u0443\u043f\u0438\u0442\u044c\u0441\u044f \u2013 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0435 \u0437\u0430\u0431\u044b\u043b \u0447\u0442\u043e-\u0442\u043e \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435, \u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u0440\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 (\u0438 \u0442\u0430\u043a \u0443\u0436 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0447\u0442\u043e \u0443 \u043f\u0440\u0435\u0434\u043a\u0430 \u0435\u0441\u0442\u044c \u0438 \u043f\u0443\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0442\u043e\u0436\u0435), \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cs\">class Textbox : Rectangle {     public required string Text { get; set; }     [SetsRequiredMembers]     public Textbox(string text)     {         Text = text;     }     public override string ToString()     {         return              $\"{{ X = {X}, Y = {Y}, W = {Width}, H = {Height}, Text = {Text}} }\";     } } <\/code><\/pre>\n<p>\u0418 \u0432\u0441\u0451 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f! \u0418 \u0434\u0430\u0436\u0435 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<pre><code class=\"cs\">var textbox = new Textbox(\"Lorem ipsum dolor sit.\"); Console.WriteLine(textbox); \/\/ { X = 0, Y = 0, Width = 0, Height = 0, Text = Lorem ipsum dolor sit. } <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0440\u0435\u0434\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0431\u0443\u0434\u0443\u0442 \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0435 \u0442\u0438\u043f\u044b, \u0442\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c null \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438, \u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2013 \u043d\u0438\u0447\u0435\u0433\u043e. \u041e\u043d\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0438\u0445\u043e \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0418 \u044d\u0442\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u2013 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0431\u044b\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043f\u043e\u043b\u0435 \u0432 \u0442\u043e\u043c \u0436\u0435 \u043a\u043b\u0430\u0441\u0441\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043e. \u0412 \u043e\u0431\u0449\u0435\u043c, \u0432\u0438\u0436\u0443 \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<h3>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440<\/h3>\n<p>\u0418 \u0435\u0449\u0451 \u043f\u0440\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0447\u043b\u0435\u043d\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u2013 \u0442\u0435\u043f\u0435\u0440\u044c, \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438, \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:<\/p>\n<pre><code class=\"cs\">struct Particle {     public int X { get; set; }     public int Y { get; set; }     public double Angle { get; set; }     public int Speed { get; set; }      public Particle(int x, int y)      {         X = x;         Y = y;     }     public override string ToString()     {         return              $\"{{ X = {X}, Y = {Y}, Angle = {Angle}, Speed = {Speed} }}\";     } }  \/\/ ....  var particle = new Particle(); Console.WriteLine(particle); \/\/ { X = 0, Y = 0, Angle = 0, Speed = 0 } <\/code><\/pre>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043c\u0430\u043b\u043e \u0447\u0442\u043e \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u0442, \u043d\u043e \u0438 \u043d\u0443\u0436\u043d\u043e \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u044f\u0437\u044b\u043a\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <a href=\"https:\/\/github.com\/dotnet\/csharplang\/issues\/140\">\u043f\u043e\u043b\u0443\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u044d\u0442\u043e\u0442 \u0440\u0435\u043b\u0438\u0437 \u043d\u0435 \u0432\u043e\u0448\u043b\u0438).<\/p>\n<h3>\u0428\u0430\u0431\u043b\u043e\u043d\u044b \u0441\u043f\u0438\u0441\u043a\u043e\u0432<\/h3>\n<p>\u041e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u2013 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0441\u043f\u0438\u0441\u043a\u0430\u043c \u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c:<\/p>\n<ul>\n<li>\n<p>\u0414\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c;<\/p>\n<\/li>\n<li>\n<p>\u0428\u0430\u0431\u043b\u043e\u043d \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 (<em>_<\/em>) \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0434\u043d\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0428\u0430\u0431\u043b\u043e\u043d \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 (<em>..<\/em>) \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0442 \u043d\u0443\u043b\u044f \u0438 \u0431\u043e\u043b\u0435\u0435. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0436\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437;<\/p>\n<\/li>\n<li>\n<p>\u0428\u0430\u0431\u043b\u043e\u043d <em>var<\/em> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e (\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430) \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438. \u0422\u0438\u043f \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044f\u0432\u043d\u043e.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u0441\u0435 \u044d\u0442\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>is<\/em>:<\/p>\n<pre><code class=\"cs\">var collection = new int[] { 0, 2, 10, 5, 4 }; if (collection is [.., > 5, _, var even] &amp;&amp; even % 2 == 0) {     Console.WriteLine(even);     \/\/ 4 } <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e (\u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 5) \u0438 \u043f\u044f\u0442\u043e\u0433\u043e (\u0447\u0451\u0442\u043d\u043e\u0441\u0442\u044c) \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<p>\u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 <em>switch<\/em>. \u0422\u0430\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0435\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u0435\u0441\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0430\u043b\u0438\u043d\u0434\u0440\u043e\u043c\u0430 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">bool IsPalindrome (string str) => str switch {     [] => true,     [_] => true,     [char first, .. string middle, char last]          => first == last ? IsPalindrome (middle) : false };  \/\/ ....  Console.WriteLine(IsPalindrome(\"civic\")); \/\/ True Console.WriteLine(IsPalindrome(\"civil\")); \/\/ False <\/code><\/pre>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0434\u0432\u0443\u0445\u043c\u0435\u0440\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435\u0442.<\/p>\n<p>\u041d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0438\u0440\u043e\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c, \u043d\u043e, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e\u0439.<\/p>\n<h3>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 nameof<\/h3>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>nameof<\/em>: \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u0435 \u0438\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435:<\/p>\n<pre><code class=\"cs\">[ScopedParameter(nameof(parameter))] void Method(string parameter) \/\/ .... [ScopedParameter(nameof(T))] void Method&lt;T>() \/\/ .... void Method([ScopedParameter(nameof(parameter))] int parameter) <\/code><\/pre>\n<p>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u043b\u044f nullable \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043b\u0438\u043a\u0432\u0438\u0434\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"cs\">[return: NotNullIfNotNull(nameof(path))] public string? GetEndpoint(string? path)     => !string.IsNullOrEmpty(path) ? BaseUrl + path : null; <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043e null \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u043d\u0435 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f:<\/p>\n<pre><code class=\"cs\">var url = GetEndpoint(\"api\/monitoring\"); var data = await RequestData(url); <\/code><\/pre>\n<h3>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0415\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0443\u0441\u044c \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u0414\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0438\u043c\u0435\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043d\u0438\u0436\u043d\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435, \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u0441 \u0445\u043e\u0442\u044f\u0442 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u043e\u0442 \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><em>nint<\/em> \u0438 <em>nuint<\/em> \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u043d\u0430 System.IntPtr \u0438 System.UIntPtr \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u0442\u0438\u043f\u043e\u0432 <em>Span&lt;char><\/em> \u0438 <em>ReadOnlySpan&lt;char><\/em>;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0433\u0440\u0443\u043f\u043f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 (method group conversion) \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u043e\u0432, \u0443\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044b \u0432 UTF-8 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435. \u0414\u043b\u044f \u0438\u0445 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0443\u0444\u0444\u0438\u043a\u0441 <em>u8<\/em> \u043a \u0441\u0442\u0440\u043e\u043a\u0435. \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0442\u0438\u043f <em>ReadOnlySpan&lt;byte><\/em>.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 file<\/h3>\n<p>\u0418 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u043d\u043e\u0432\u043e\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0431\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0442\u0438\u043f\u043e\u0432, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0430\u044f \u0444\u0430\u0439\u043b\u043e\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d. \u041e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u043e \u044d\u0442\u043e \u043d\u0443\u0436\u0434\u0430\u043c\u0438 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u2013 \u0436\u0435\u043b\u0430\u043d\u0438\u0435\u043c \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0438\u043c\u0451\u043d.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0435\u0441\u043b\u0438 \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 (\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d) \u043a\u043b\u0430\u0441\u0441\u044b, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043a \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <em>file<\/em>:<\/p>\n<pre><code class=\"cs\">\/\/ Generated.cs file class Canvas {     public void Render()     {         \/\/ ....     } } <\/code><\/pre>\n<p>\u0410 \u0432\u0442\u043e\u0440\u043e\u0439 \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e:<\/p>\n<pre><code class=\"cs\">\/\/ Canvas.cs public class Canvas {     public void Draw()     {         \/\/ ....     } } <\/code><\/pre>\n<p>\u0422\u043e \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0438\u043a\u0442\u043e \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0435-\u0444\u0430\u043a\u0442\u043e \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0431\u0435\u0437 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u0432\u043e\u0437\u043d\u0438\u043a \u0432\u043e\u043f\u0440\u043e\u0441, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <em>private<\/em> \u2013 \u0442\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e. \u0422\u0430\u043a \u043a\u0430\u043a \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043a \u0444\u0430\u0439\u043b\u0443 (\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0443 \u0438\u043c\u0451\u043d), \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043b\u0438\u043a\u0432\u0438\u0434\u0438\u0440\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u043d\u0435\u0434\u043e\u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0432\u044b\u0448\u043b\u0430 \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u044f\u0437\u044b\u043a\u0430. \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u043e, \u043d\u0435 \u0432\u0441\u0435 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0432\u0441\u0435\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f: \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b, \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043d\u0435 \u043e\u043a\u0430\u0436\u0443\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0432\u043b\u0438\u044f\u043d\u0438\u044f, \u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438 \u0432\u043e\u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0441\u043b\u0443\u0436\u0430\u0442 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u043e\u043c \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u044f\u0437\u044b\u043a\u0430. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0435\u0441\u0442\u044c \u0438 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435. \u0414\u043b\u044f \u043c\u0435\u043d\u044f \u0442\u0430\u043a\u0438\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0442\u0430\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f. \u0423\u0432\u0435\u0440\u0435\u043d, \u0438 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0447\u0442\u043e-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435!<\/p>\n<p>\u0417\u0430 \u0432\u0441\u0435\u043c\u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u043e \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 C# \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 <a href=\"https:\/\/docs.microsoft.com\/dotnet\/csharp\/whats-new\/csharp-11\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u044f\u0437\u044b\u043a\u0430, \u0442\u043e \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u044e \u0432\u0430\u0441 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430\u0448\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/blog\/posts\/csharp\/0860\/\">\u041e\u0431\u0437\u043e\u0440 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u0432 C# 9<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/blog\/posts\/csharp\/0875\/\">\u041e\u0431\u0437\u043e\u0440 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u0432 C# 10<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u043c\u043d\u043e\u0439, \u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043c\u043e\u0439 <a href=\"https:\/\/twitter.com\/kvolokhovskii\">Twitter<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Konstantin Volohovsky. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/csharp\/1002\/\">What&#8217;s new in C# 11: overview<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/694792\/\"> https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/694792\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>C# 11 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0443\u0436\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0441\u043a\u043e\u0440\u043e, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0440\u0430 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0432 \u044f\u0437\u044b\u043a\u0435. \u0418 \u0445\u043e\u0442\u044f \u0438\u0445 \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435: \u043e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u0430\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430, \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 required, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0442\u0438\u043f\u0430 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u041e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043f\u043e\u0447\u0442\u0438 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438. \u0425\u043e\u0442\u044c \u043c\u044b \u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u043c\u043e\u0433\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0442\u0438\u043f \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430, \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0442\u0438\u043f\u044b \u043f\u043e\u0434\u043b\u0435\u0436\u0430\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0447\u0435\u0440\u0435\u0437 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u0435\u043b\u044c \u0442\u0438\u043f\u0430 <em>where<\/em>. \u0410 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>typeof<\/em>.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 &#171;<a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%B5%D0%BA%D0%BE%D1%80%D0%B0%D1%82%D0%BE%D1%80_(%D1%88%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD_%D0%BF%D1%80%D0%BE%D0%B5%D0%BA%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F)\">\u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440<\/a>&#171;. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0441\u0430\u043c \u043e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442:<\/p>\n<pre><code class=\"cs\">[AttributeUsage(AttributeTargets.Class)] public class DecorateAttribute&lt;T> : Attribute where T : class {     public Type DecoratorType{ get; set; }     public DecorateAttribute()     {         DecoratorType = typeof(T);     } } <\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043a\u0430\u043a \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u043c, \u0442\u0430\u043a \u0438 \u0444\u0430\u0431\u0440\u0438\u043a\u0443 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u0435\u043a\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u043d\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <em>Decorate<\/em>:<\/p>\n<pre><code class=\"cs\">public interface IWorker {     public void Action(); } public class LoggerDecorator : IWorker {     private IWorker _worker;     public LoggerDecorator(IWorker worker)     {         _worker = worker;     }     public void Action()     {         Console.WriteLine(\"Log before\");         _worker.Action();         Console.WriteLine(\"Log after\");     } } [Decorate&lt;LoggerDecorator>] public class SimpleWorker : IWorker {     public void Action()     {         Console.WriteLine(\"Working..\");     } }  public static class WorkerFactory {     public static IWorker CreateWorker()     {         IWorker worker = new SimpleWorker();          if (typeof(SimpleWorker)             .GetCustomAttribute&lt;DecorateAttribute&lt;LoggerDecorator>>() != null)         {             worker = new LoggerDecorator(worker);         }          return worker;     } } <\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<pre><code class=\"cs\">var worker = WorkerFactory.CreateWorker();  worker.Action(); \/\/ Log before \/\/ Working.. \/\/ Log after <\/code><\/pre>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0441\u043d\u044f\u0442\u044b \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u2013 \u0442\u0438\u043f \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044f\u0432\u043d\u043e. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0442\u0438\u043f\u0430 \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f:<\/p>\n<pre><code class=\"cs\">public class GenericAttribute&lt;T> : Attribute { } public class GenericClass&lt;T> {     [GenericAttribute&lt;T>]     \/\/Error CS8968 'T': an attribute type argument cannot use type parameters     public void Action()     {         \/\/ ....     } } <\/code><\/pre>\n<p>\u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441: <em>GenericAttribute&lt;int><\/em> \u0438 <em>GenericAttribute&lt;string><\/em> \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043e\u0434\u043d\u043e\u0433\u043e? \u0412 Microsoft \u0440\u0435\u0448\u0438\u043b\u0438, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435. \u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0442\u0435\u043a\u0430\u0435\u0442, \u0447\u0442\u043e \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <em>AllowMultiple<\/em> \u0432 <em>true<\/em>. \u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cs\">[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] public class DecorateAttribute&lt;T> : Attribute where T : class {     \/\/ .... } <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043a\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437:<\/p>\n<pre><code class=\"cs\">[Decorate&lt;LoggerDecorator>] [Decorate&lt;TimerDecorator>] public class SimpleWorker : IWorker {     \/\/ .... } <\/code><\/pre>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0438\u0447\u0435\u0433\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u0440\u0438\u0432\u043d\u0435\u0441\u043b\u043e, \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445.<\/p>\n<h3>\u041e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u0430\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430<\/h3>\n<p>\u0421 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044f\u0437\u044b\u043a\u0430 \u043d\u0430\u043c \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 \u043e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u0434\u0432\u0443\u0445 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u0445 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 (\u0438\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e) \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <em>abstract<\/em>, \u043e\u0431\u044f\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434;<\/p>\n<\/li>\n<li>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u0445 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0432\u0438\u0434\u0430 <em>static abstract<\/em>, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u043c, \u043d\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043b\u0438\u0448\u0435\u043d\u043d\u044b\u043c \u0441\u043c\u044b\u0441\u043b\u0430 \u044f \u0431\u044b \u044d\u0442\u043e \u043d\u0435 \u043d\u0430\u0437\u0432\u0430\u043b. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0434\u0435\u043b\u0435, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"cs\">public interface IAddable&lt;TLeft, TRight, TResult>     where TLeft : IAddable&lt;TLeft, TRight, TResult> {     static abstract TResult operator +(TLeft left, TRight right); } public interface IParsable&lt;T> where T : IParsable&lt;T> {     static abstract T Parse(string s); } public record Natural : IAddable&lt;Natural, Natural, Natural>, IParsable&lt;Natural> {     public int Value { get; init; } = 0;     public static Natural Parse(string s)     {         return new() { Value = int.Parse(s) };     }     public static Natural operator +(Natural left, Natural right)     {         return new() { Value = left.Value + right.Value };     } } <\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0432 \u0434\u0435\u043b\u0435 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">var one = new Natural { Value = 1 }; var two = new Natural { Value = 2 }; var three = one + two; Console.WriteLine(three); \/\/ Natural { Value = 3 }  var parsed = Natural.Parse(\"42\"); Console.WriteLine(parsed); \/\/ Natural { Value = 42 } <\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Curiously_recurring_template_pattern\">\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430<\/a> \u0432\u0438\u0434\u0430 <em>Natural: IParsable&lt;Natural><\/em>. \u0421 \u043d\u0438\u043c \u043d\u0430\u0434\u043e \u0431\u044b\u0442\u044c \u043f\u043e\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0442\u0438\u043f\u0430 \u2014<em>Natural : IParsable&lt;OtherParsableType><\/em>.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043d\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0442\u0438\u043f\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0430 \u0442\u0430\u043a\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<\/p>\n<pre><code class=\"cs\">public IEnumerable&lt;T> ParseCsvRow&lt;T>(string content) where T : IParsable&lt;T>     => content.Split(',').Select(T.Parse); \/\/ .... var row = ParseCsvRow&lt;Natural>(\"1,5,2\"); Console.WriteLine(string.Join(' ', row.Select(x => x.Value))); \/\/ 1 5 2 <\/code><\/pre>\n<p>\u0420\u0430\u043d\u044c\u0448\u0435 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0442\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u044b\u043b\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u2013 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0438\u043f. \u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043b\u044e\u0431\u044b\u043c \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u043c <em>IParsable<\/em>.<\/p>\n<p>\u0417\u0430\u0434\u0430\u043d\u0438\u0435\u043c \u0441\u0432\u043e\u0435\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0434\u0435\u043b\u043e \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0411\u044b\u043b \u0438\u0437\u043c\u0435\u043d\u0451\u043d \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0442\u0438\u043f\u043e\u0432: 20 \u0438\u0437 \u043d\u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/standard\/generics\/math\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/p>\n<p>\u0413\u043b\u0430\u0432\u043d\u044b\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <em>INumber<\/em> \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">static T Sum&lt;T>(IEnumerable&lt;T> values)     where T : INumber&lt;T> {     T result = T.Zero;     foreach (var value in values)     {         result += T.CreateChecked(value);     }     return result; } <\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u0441 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u043c\u0438, \u0442\u0430\u043a \u0438 \u0441 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438:<\/p>\n<pre><code class=\"cs\">Console.WriteLine(Sum(new int[] { 1, 2, 3, 4, 5 })); \/\/ 15  Console.WriteLine(Sum(new double[] { 0.5, 2.5, 3.0, 4.3, 3.2 })); \/\/ 13.5 <\/code><\/pre>\n<p>\u0418 \u044d\u0442\u043e \u043d\u0435 \u0432\u0441\u0451. \u0422\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0431\u0438\u0442\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430, \u043d\u043e \u0432\u0441\u044f \u044d\u0442\u0430 \u0442\u0435\u043c\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c \u0434\u043e\u0441\u0442\u043e\u0439\u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u0430 \u043f\u043e\u043a\u0430 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u044e \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u0432 <a href=\"https:\/\/learn.microsoft.com\/dotnet\/standard\/generics\/math\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/a>.<\/p>\n<p>\u042f \u0436\u0435 \u043f\u043e\u0434\u0432\u0435\u0434\u0443 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438\u0442\u043e\u0433\u0438. \u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u0438\u043c, \u0432\u0435\u0434\u044c \u043d\u0435 \u0432\u0441\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438. \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <em>static abstract<\/em> \u0442\u0430\u043a\u0436\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u0430 \u0447\u0442\u043e\u0431\u044b \u0431\u0440\u043e\u0441\u0430\u0442\u044c\u0441\u044f \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u0435\u0451 \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u0436\u0438\u0437\u043d\u044c \u043b\u0443\u0447\u0448\u0435 \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u043e \u2013 \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0441\u043c\u043e\u0433\u0443\u0442 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0431\u0435\u0441\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043e\u043a.<\/p>\n<h3>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044b<\/h3>\n<p>\u0412 C# \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c &#171;\u0441\u044b\u0440\u044b\u0435&#187; \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e (\u043e\u0442 \u0442\u0440\u0451\u0445) \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u0430\u0432\u044b\u0447\u0435\u043a. \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 @, \u043d\u043e \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0432\u0430\u0436\u043d\u044b\u0445 \u043e\u0442\u043b\u0438\u0447\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0438 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a \u0432\u0441\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b, \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u043c \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u043c, \u0431\u0443\u0434\u0443\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u044b \u0438\u0437 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0432\u044b\u0447\u043a\u0438 (\u0438 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 \u043f\u0440\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438).<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u043e\u0437\u044c\u043c\u0451\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 json \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cs\">string GetJsonForecast(DateTime date, int temperature, string summary)     => $$\"\"\"     {         \"Date\": \"{{date.ToString(\"yyyy-MM-dd\")}}\",          \"TemperatureCelsius\": \"{{temperature}}\",         \"Summary\": \"{{summary}}\",         \"Note\": \"\"     }     \"\"\"; <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0432\u0438\u0434\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e json:<\/p>\n<pre><code class=\"cs\">{     \"Date\": \"2022-09-16\",     \"TemperatureCelsius\": 10,     \"Summary\": \"Windy\",     \"Note\": \"\" } <\/code><\/pre>\n<p>\u041e\u0442\u043b\u0438\u0447\u0438\u044f \u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 @ \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e: \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u043b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u043b \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u044f\u0442 &#171;\u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e&#187; \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u043c\u0438 \u0438 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u043c\u0438 \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438, \u0430 \u043b\u0438\u0448\u043d\u0438\u0445 \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 \u0441\u043b\u0435\u0432\u0430 \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442. \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 &#171;\u0441\u044b\u0440\u044b\u043c\u0438&#187; \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0442\u0430\u043a\u0438\u0435:<\/p>\n<ul>\n<li>\n<p>\u0421\u0442\u0440\u043e\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0441 3-\u0445 \u0438 \u0431\u043e\u043b\u0435\u0435 \u043a\u0430\u0432\u044b\u0447\u0435\u043a. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u0435 3 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u043f\u043e\u0434\u0440\u044f\u0434, \u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0443\u0436\u043d\u043e 4 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0435\u0439, \u043d\u043e \u0443\u0436\u0435 \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430. \u0422\u0430\u043a, \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0434\u0432\u0430 \u0437\u043d\u0430\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b json;<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0439. \u0422\u043e\u0433\u0434\u0430 \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u0441\u0438\u043c\u0432\u043e\u043b \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0439. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 (\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 \u043d\u0438\u0445 \u0442\u0435\u043a\u0441\u0442 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442\u0441\u044f), \u0430 \u043e\u0442\u0441\u0442\u0443\u043f \u0443 \u0442\u0435\u043a\u0441\u0442\u0430 \u043e\u0442 \u043a\u0440\u0430\u044f \u044d\u043a\u0440\u0430\u043d\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0443 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u043a\u0430\u0432\u044b\u0447\u0435\u043a.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a \u043d\u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044b, \u043d\u0435 \u0431\u043e\u044f\u0441\u044c \u043d\u0438 \u0437\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0439\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0438, \u043d\u0438 \u0437\u0430 \u043e\u043f\u0440\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430. \u041d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e: \u0437\u0430\u0447\u0435\u043c \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0431\u043e\u043b\u0435\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430?<\/p>\n<h3>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u0440\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438<\/h3>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u043e, \u043d\u0430 \u0441\u0435\u0439 \u0440\u0430\u0437 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435, \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438: \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443:<\/p>\n<pre><code class=\"cs\">Console.WriteLine(     $\"Roles in {department.Name} department are: {         string.Join(\", \", department.Employees                                     .Where(x => x.Active)                                     .Select(x => x.Role)                                     .OrderBy(x => x)                                     .Distinct())}\");  \/\/ Roles in Security department<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-340060","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340060","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=340060"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340060\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=340060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=340060"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=340060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}