{"id":258924,"date":"2015-06-09T08:04:02","date_gmt":"2015-06-09T04:04:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=258924"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=258924","title":{"rendered":"\u0420\u0435\u043d\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 2: \u043a\u0440\u0430\u0434\u0443\u0449\u0438\u0439\u0441\u044f DDD, \u0437\u0430\u0442\u0430\u0438\u0432\u0448\u0438\u0439\u0441\u044f CQRS"},"content":{"rendered":"<p>     \t<img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ca3\/b34\/8d0\/ca3b348d0d76405e94b08186043afb08.jpg\"\/>  <\/p>\n<blockquote><p>\u0422\u0440\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u044c \u043f\u043e\u043b\u0435, \u0438 \u0434\u043e\u0439\u0442\u0438 \u0434\u043e \u0434\u043e\u043c\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442-\u043d\u043e\u0432\u0438\u0447\u043e\u043a \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u043a\u043e\u0440\u043e\u0442\u043a\u0443\u044e \u0434\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u044e \u0438 \u0441\u043a\u0430\u0437\u0430\u043b, \u00ab\u042d\u0442\u043e \u043d\u0435 \u0434\u0430\u043b\u0435\u043a\u043e! \u042d\u0442\u043e \u0437\u0430\u0439\u043c\u0435\u0442 \u0443 \u043c\u0435\u043d\u044f \u0434\u0435\u0441\u044f\u0442\u044c \u043c\u0438\u043d\u0443\u0442\u00bb. \u041e\u043f\u044b\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u043f\u043e\u043b\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0438 \u0441\u043a\u0430\u0437\u0430\u043b: \u00ab\u042f \u043c\u043e\u0433 \u0431\u044b \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0442\u0443\u0434\u0430 \u0437\u0430 \u0434\u0435\u043d\u044c\u00bb. \u041d\u043e\u0432\u0438\u0447\u043e\u043a \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u043d\u0435\u0433\u043e \u0441 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435\u043c. \u0413\u0443\u0440\u0443-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u043f\u043e\u043b\u0435 \u0438 \u0441\u043a\u0430\u0437\u0430\u043b. \u00ab\u041a\u0430\u0436\u0435\u0442\u0441\u044f \u043c\u0438\u043d\u0443\u0442 \u0434\u0435\u0441\u044f\u0442\u044c, \u043d\u043e \u044f \u0434\u0443\u043c\u0430\u044e \u043f\u044f\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u00bb. \u041e\u043f\u044b\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0440\u0430\u0441\u0441\u043c\u0435\u044f\u043b\u0441\u044f.<\/p>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442-\u043d\u043e\u0432\u0438\u0447\u043e\u043a \u0434\u0432\u0438\u043d\u0443\u043b\u0441\u044f \u0432 \u043f\u0443\u0442\u044c, \u043d\u043e \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u0438\u0439, \u043d\u0430\u0447\u0430\u043b\u0438 \u0432\u0437\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0438\u043d\u044b, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043f\u043e\u0441\u043b\u0435 \u0441\u0435\u0431\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u044f\u043c\u044b. \u041e\u0442 \u0432\u0437\u0440\u044b\u0432\u043e\u0432 \u043e\u043d \u043e\u0442\u043b\u0435\u0442\u0430\u043b \u043d\u0430\u0437\u0430\u0434, \u0438 \u0435\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043d\u043e\u0432\u0430 \u0438 \u0441\u043d\u043e\u0432\u0430. \u0423 \u043d\u0435\u0433\u043e \u0443\u0448\u043b\u043e \u0434\u0432\u0430 \u0434\u043d\u044f \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u0446\u0435\u043b\u0438. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043e\u043d \u0432\u0435\u0441\u044c \u0442\u0440\u044f\u0441\u0441\u044f \u0438 \u0431\u044b\u043b \u0440\u0430\u043d\u0435\u043d, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0448\u0435\u043b.<\/p>\n<p>  \u041e\u043f\u044b\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u043e\u043f\u043e\u043b\u0437 \u043d\u0430 \u0447\u0435\u0442\u0432\u0435\u0440\u0435\u043d\u044c\u043a\u0430\u0445. \u041e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e \u0449\u0443\u043f\u0430\u044f \u0437\u0435\u043c\u043b\u044e \u0438 \u0438\u0449\u0430 \u043c\u0438\u043d\u044b, \u0434\u0432\u0438\u0433\u0430\u044f\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0431\u044b\u043b \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e. \u041c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0438 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e \u043e\u043d \u043f\u0435\u0440\u0435\u0441\u0435\u043a \u043f\u043e\u043b\u0435 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u043d\u044f. \u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0434\u0435\u0432 \u043f\u0430\u0440\u0443 \u043c\u0438\u043d.<\/p>\n<p>  \u0413\u0443\u0440\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f \u0432 \u043f\u0443\u0442\u044c, \u0438 \u043f\u043e\u0448\u0435\u043b \u043f\u0440\u044f\u043c\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u043b\u0435. \u0426\u0435\u043b\u0435\u0443\u0441\u0442\u0440\u0435\u043c\u043b\u0435\u043d\u043d\u043e \u0438 \u043f\u0440\u044f\u043c\u043e. \u041e\u043d \u0434\u043e\u0441\u0442\u0438\u0433 \u0446\u0435\u043b\u0438 \u0432\u0441\u0435\u0433\u043e \u0437\u0430 \u0434\u0435\u0441\u044f\u0442\u044c \u043c\u0438\u043d\u0443\u0442.<br \/>  \u00ab\u041a\u0430\u043a \u0442\u0435\u0431\u0435 \u044d\u0442\u043e \u0443\u0434\u0430\u043b\u043e\u0441\u044c?\u00bb \u2014 \u0441\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u0434\u0432\u043e\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u2014 \u00ab\u041a\u0430\u043a \u0442\u044b \u0443\u043c\u0443\u0434\u0440\u0438\u043b\u0441\u044f \u043d\u0435 \u0437\u0430\u0446\u0435\u043f\u0438\u0442\u044c \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u043c\u0438\u043d\u044b?\u00bb<br \/>  \u00ab\u041b\u0435\u0433\u043a\u043e.\u00bb \u2014 \u043e\u0442\u0432\u0435\u0442\u0438\u043b \u043e\u043d. \u00ab\u042f \u043d\u0435 \u0437\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043b \u043c\u0438\u043d\u044b \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u043f\u0443\u0442\u0438\u00bb.  <\/p><\/blockquote>\n<p>  \u041a\u0430\u043a \u043d\u0438 \u043f\u0440\u0438\u0441\u043a\u043e\u0440\u0431\u043d\u043e, \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c \u2013 \u043c\u044b \u0441\u0430\u043c\u0438 \u0437\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0441\u0435\u0431\u0435 \u043c\u0438\u043d\u044b. \u0412 <a href=\"http:\/\/habrahabr.ru\/post\/233221\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0440\u0438\u0441\u043a\u0438 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u041f\u041e \u0438 \u043e\u043f\u0438\u0441\u0430\u043b \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043e\u0441\u043b\u0430\u0431\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0440\u0438\u0441\u043a\u043e\u0432. \u0417\u0430 \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0439 \u0433\u043e\u0434 \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043c\u044b\u0441\u043b \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443: \u00ab\u0432\u0441\u0435 \u043a\u0440\u0443\u0442\u043e, \u043d\u043e \u0441 \u0447\u0435\u0433\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0438 \u043a\u0430\u043a \u0432\u0441\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0438\u0440\u0435\u00bb. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043d\u043e\u0441\u0438\u0442 \u0441\u043a\u043e\u0440\u0435\u0435 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441\u0441\u044b\u043b\u043e\u043a. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430\u043c, \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0449\u0438\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c, \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 <a href=\"http:\/\/habrahabr.ru\/post\/233221\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u044b, \u0432\u0435\u0434\u044c \u043e\u043d\u0438 \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 long run\u2019\u0435: \u043d\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0441\u0430\u0439\u0442 \u043d\u0430 \u0434\u0435\u0441\u044f\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u0435\u043a \u0441 \u043f\u0430\u0440\u043e\u0439 \u0444\u043e\u0440\u043c\u043e\u0447\u0435\u043a \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 CRUD-\u0430\u0434\u043c\u0438\u043d\u043a\u043e\u0439, \u0435\u0441\u043b\u0438 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0441 \u043d\u0443\u043b\u044f \u0437\u0430 \u043f\u0430\u0440\u0443 \u0434\u043d\u0435\u0439. \u041d\u043e \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u043b\u0442\u043e\u0440\u0430-\u0434\u0432\u0430 \u0433\u043e\u0434\u0430?<\/p>\n<p>  \u041d\u0430\u0448 \u0441\u0430\u0439\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u0435\u043a \u0438 \u0444\u043e\u0440\u043c\u043e\u0447\u0435\u043a \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u043a\u0438 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0430\u043c\u0438. \u041c\u044b \u0434\u0430\u043b\u0438 \u0440\u0435\u043a\u043b\u0430\u043c\u0443 \u0432 \u043f\u0430\u0431\u043b\u0438\u043a\u0435-\u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0438\u043a\u0435 \u00ab\u0412\u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0435\u00bb \u0438 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u00ab\u0441\u043b\u043e\u0436\u0438\u043b\u0430\u0441\u044c\u00bb \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439. \u041d\u0435 \u0431\u0435\u0434\u0430, \u0432\u0442\u044b\u043a\u0430\u0435\u043c \u043a\u0435\u0448. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0437\u0430\u043f\u0430\u0440\u0442\u043d\u0435\u0440\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0440\u0443\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c. \u041a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0438\u043c \u043a\u043e\u0434 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u043e\u043c \u0438\u0437 \u0435\u0433\u043e \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b, \u043f\u0438\u0448\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u043c\u043a\u0438 \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u00ab\u043d\u0430\u0448\u0438\u0445\u00bb \u0438 \u00ab\u0432\u043d\u0435\u0448\u043d\u0438\u0445\u00bb \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u041d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u043a\u0435\u0448 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0433\u043e\u0432 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u0431\u0435\u043a\u043b\u043e\u0433\u0435 \u0440\u0430\u0441\u0442\u0435\u0442.<br \/>  \u041f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 6-7 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441 \u043f\u0440\u0430\u0432\u0438\u043b, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u043e\u0442 \u0443\u0436\u0435 \u0443 \u043d\u0430\u0441 \u0447\u0443\u0434\u043e\u0432\u0438\u0449\u0435 \u0424\u0440\u0430\u043d\u043a\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430, \u0441\u0448\u0438\u0442\u043e\u0435 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u0434\u0430 \u0441\u043e Stack Overflow, \u043a\u043e\u0434\u0430 SDK \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u043e\u0432, \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439 \u0438 \u0445\u043e\u0442\u043f\u0430\u0442\u0447\u0435\u0439, \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 3rd party \u2013 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u043e\u0432.<\/p>\n<h4>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 2-3 \u043b\u0435\u0442\u043d\u0435\u0439 \u0434\u0430\u0432\u043d\u043e\u0441\u0442\u0438<\/h4>\n<p>  <\/p>\n<ol>\n<li>\u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435 boiler-plate-\u043a\u043e\u0434\u0430 (\u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 using, try-catch, log \u0438 \u0442.\u0434.): \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u0435\u0442 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0438 \u0440\u0435\u0444\u0430\u0442\u043e\u0440\u0438\u043d\u0433, \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0441\u044a\u0435\u0434\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 (\u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0434\u043d\u0438 \u2014 \u0447\u0435\u0440\u0435\u0437 \u0433\u043e\u0434-\u0434\u0432\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b)<\/li>\n<li>\u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430, \u0432 \u0442.\u0447 \u043d\u0435\u044f\u0432\u043d\u043e\u0435, \u0431\u0435\u0437\u0434\u0443\u043c\u043d\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 Entity, DTO \u0438 ViewModel, \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 Linq-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 ITEntityRepository: IRepository&lt;TEntity&gt;, \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e<\/li>\n<li>\u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435 SRP: \u0437\u0430\u043f\u0438\u0445\u0438\u0432\u0430\u043d\u0438\u0435 \u0432 Entity \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u0438 \u0434\u0430\u0436\u0435 \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0434\u043e\u043c\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 Manager\u2019\u043e\u0432, Service\u2019\u043e\u0432 \u0438 Helper\u2019\u043e\u0432 \u0441 \u043d\u0435\u0432\u043d\u044f\u0442\u043d\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e<\/li>\n<li>\u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435 LSP<\/li>\n<li>NullReferenceExcetion<\/li>\n<li>\u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<li>\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438, \u043f\u0435\u0440\u0435\u043c\u0435\u0448\u0438\u0432\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0435\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u043a\u043e\u0434\u0430 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438<\/li>\n<\/ol>\n<p>  \u041e\u0431\u044b\u0447\u043d\u043e \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u0438\u0435\u043c \u0432\u0441\u0435\u043c\u0443 \u044d\u0442\u043e\u043c\u0443 \u0431\u0435\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u044e \u0441\u043b\u0443\u0436\u0430\u0442:  <\/p>\n<ol>\n<li>c\u0436\u0430\u0442\u044b\u0435 \u0441\u0440\u043e\u043a\u0438 \u0440\u0435\u043b\u0438\u0437\u0430<\/li>\n<li>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433<\/li>\n<li>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (\u043a\u0430\u043a\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430? \u0444\u0438\u0433\u0430\u0447\u0438\u0442\u044c \u043d\u0430\u0434\u043e!)<\/li>\n<\/ol>\n<p>  \u0412 \u0446\u0435\u043b\u043e\u043c, \u0432\u0441\u0435 \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0434\u0438\u0432\u043e, \u043d\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u00ab\u043c\u0430\u0442-\u0447\u0430\u0441\u0442\u0438\u00bb, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u0435\u0440\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u041f\u043e\u0434 \u0432\u0435\u0440\u043d\u044b\u043c\u0438 \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0435\u0449\u0435\u0439: \u043d\u0430 80% \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u043a\u043e\u0434, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u0435\u0439\u0441, \u0430 \u043d\u0430 20% \u2014 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0437\u0430\u0434\u0435\u043b \u043d\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0435, \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0443\u0433\u0430\u0434\u044b\u0432\u0430\u044f \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e 20% \u043d\u0430\u0434\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c (\u0438\u043d\u0430\u0447\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u0441\u044f \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f). \u0427\u0442\u043e\u0431\u044b \u0443\u0433\u0430\u0434\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0437\u0430\u0445\u043e\u0442\u044f\u0442 \u0441\u0442\u0435\u0439\u043a\u0445\u043e\u043b\u0434\u0435\u0440\u044b (\u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043e\u043c\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f) \u043e\u0431\u044b\u0447\u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u043f\u044b\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0438\/\u0438\u043b\u0438 \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0445 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0430\u0441\u0442\u0443\u0449\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445:  <\/p>\n<ol>\n<li>\u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f (\u043f\u0435\u0447\u0430\u043b\u044c\u043d\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0445\u0430\u0431\u0440\u0430-\u044d\u0444\u0444\u0435\u043a\u0442), \u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u043f\u043e\u043a\u0430\u0437\u043e\u0432, \u043b\u0430\u0439\u043a\u043e\u0432 \u0438 \u0442.\u0434.<\/li>\n<li>\u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f (\u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0432\u043e\u0440\u043e\u043d\u043e\u043a \u043f\u0440\u043e\u0434\u0430\u0436, \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0439 \u0441 \u0446\u0435\u043b\u044c\u044e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442)<\/li>\n<li>\u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0438\u0441\u043a<\/li>\n<li>\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0438 \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e<\/li>\n<li>\u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<li>\u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439, \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433, \u0441\u0430\u043c\u043e-\u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430, \u0441\u0430\u043c\u043e-\u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0435\u0432 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a<\/li>\n<\/ol>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043c\u0435\u043d\u0430 (\u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u0430\u0432\u0438\u043b) \u043e\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412\u0441\u044f\u043a\u043e\u0435 AOP, \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u0438 \u043f\u0440\u043e\u0447\u0443\u044e \u043c\u0430\u0433\u0438\u044e \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437.<\/p>\n<h2>10 \u0441\u043b\u043e\u0435\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/68f\/47a\/8dc\/68f47a8dca0d4fa2b904ca407c45306c.png\"\/><\/p>\n<p>  \u0414\u043b\u044f \u00ab\u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0432\u0430\u043a\u0443\u0443\u043c\u0435\u00bb \u044f \u043d\u0430\u0441\u0447\u0438\u0442\u0430\u043b \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c 10 \u0441\u043b\u043e\u0435\u0432. \u041c\u043d\u043e\u0433\u043e \u044d\u0442\u043e \u0438\u043b\u0438 \u043c\u0430\u043b\u043e? \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u00ab\u0441\u0440\u0435\u0437\u0430\u0442\u044c \u0443\u0433\u043b\u044b\u00bb \u0438 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0442\u0440\u0435\u043c\u044f, \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0432 \u0441\u0430\u043c\u044b\u0439 \u0440\u0430\u0437. \u0412\u044b\u043d\u043e\u0441\u0438\u043c \u0437\u0430 \u0441\u043a\u043e\u0431\u043a\u0438 \u044d\u043d\u0434\u043f\u043e\u0438\u0442\u044b, \u0434\u0435\u0439\u0442\u0430-\u043c\u0430\u043f\u043f\u0435\u0440, \u043f\u0430\u0431\u043b\u0438\u0448\u0435\u0440-\u0441\u0430\u0431\u0441\u043a\u0440\u0430\u0439\u0431\u0435\u0440, \u0438\u043d\u0442\u0440\u0435\u0446\u0435\u043f\u0442\u043e\u0440\u044b. \u041e\u0441\u0442\u0430\u043b\u0438\u0441\u044c:  <\/p>\n<ol>\n<li>\u0421\u0435\u0440\u0432\u0438\u0441\u044b<\/li>\n<li>Command\/Query<\/li>\n<li>Entity<\/li>\n<li>DAO<\/li>\n<\/ol>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u043e \u043c\u0435\u0441\u0442\u0430\u043c \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2013 \u043b\u0435\u043d\u0434\u0438\u043d\u0433 \u043f\u0435\u0439\u0434\u0436.  <\/p>\n<blockquote><p>\u0426\u0435\u043b\u0435\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 (\u0430\u043d\u0433\u043b. \u00ablanding page\u00bb) \u2014 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u043e\u0439, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0431\u043e\u0440 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0443\u0441\u0438\u043b\u0435\u043d\u0438\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u043a\u043b\u0430\u043c\u044b, \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438&#8230;<\/p><\/blockquote>\n<p>  \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0430 \u0438 \u043e\u043d\u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u00ab\u043b\u0438\u0434\u043e\u0432\u00bb. \u0423 \u043b\u0438\u0434\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c email. \u041d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u043d\u0430 \u0444\u043e\u0440\u043c\u0435 \u0431\u0443\u0434\u0443\u0442 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u0438 \u0438\u043c\u044f. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 \u00ab\u043b\u0438\u0434\u0430\u00bb:  <\/p>\n<pre><code>    public interface IEntity     {         string GetId();      }      public class Lead : IEntity     {         public static Expression&lt;Func&lt;Lead, bool&gt;&gt; ProcessedRule = x =&gt; x.Processed;          private string _email;          [Key, Index(&quot;IX_Email&quot;, 1, IsUnique = true)]         public string Email         {             get { return _email; }             set             {                 if (string.IsNullOrEmpty(value))                 {                     throw new ArgumentNullException(&quot;value&quot;);                 }                  _email = value;             }         }          public string Phone { get; set; }          public bool Processed { get; set; }          public DateTime CreatedDate { get; set; }          [Obsolete(&quot;Only for model binders and EF, don't use it in your code&quot;, true)]         internal Lead()         {                      }          public Lead([NotNull] string email, string phone = null)         {             Email = email;             Phone = phone;             CreatedDate = DateTime.Now;         }          public bool IsProcessed()         {             return this.Is(ProcessedRule);         }          public string GetId()         {             return Email;         }     } <\/code><\/pre>\n<h2>Entity, Rich Domain Model \u0438 \u0437\u0430\u0449\u0438\u0442\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (aka \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u044f)<\/h2>\n<p>\u041f\u043e\u043b\u0435\u043c\u0438\u043a\u0430: <a href=\"http:\/\/samolisov.blogspot.ru\/2012\/10\/anemic-domain-model.html\">samolisov.blogspot.ru\/2012\/10\/anemic-domain-model.html<\/a><br \/>  \u042f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043a \u0431\u043e\u0433\u0430\u0442\u043e\u0439 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 (Rich Domain Model) \u0438 \u043d\u0435 \u043b\u044e\u0431\u043b\u044e \u0430\u043d\u0435\u043c\u0438\u0447\u043d\u0443\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 Lead \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u043c \u0438 \u043d\u0435 \u0434\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f \u0432 \u043d\u0435\u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 (\u043d\u0430\u0440\u0443\u0448\u0438\u0442\u044c \u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442). \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 ORM-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438, \u0447\u044c\u0438 \u043f\u0440\u0435\u0434\u043a\u0438 \u043f\u043e\u0440\u043e\u0434\u0438\u043b\u0438 \u0430\u043d\u0435\u043c\u0438\u0447\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u0443\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0438\u043d\u043a\u0430\u043f\u0443\u0441\u043b\u044f\u0446\u0438\u0438 (\u043d\u0443 \u043f\u043e\u0447\u0442\u0438). \u041d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 internal. \u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u043d\u0435 \u043c\u043e\u0435\u0442 \u0440\u0443\u043a\u0438 \u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0434\u043e\u043c\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0435\u0441\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 [Obsolete]. \u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0441\u043b\u043e\u043c\u0430\u0435\u0442 \u0431\u0438\u043b\u0434 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0432 \u044f\u0432\u043d\u043e\u043c \u0432\u0438\u0434\u0435, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0430\u0448\u0438 ORM \u0438 ModelBinder \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u044d\u0442\u0438\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u043c.  <\/p>\n<pre><code>        [Obsolete(&quot;Only for model binders and EF, don't use it in your code&quot;, true)]         internal Lead()         {                      }          public Lead([NotNull] string email, string phone = null)         {             Email = email;             Phone = phone;             CreatedDate = DateTime.Now;         } <\/code><\/pre>\n<p>  \u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0438, \u0447\u0442\u043e \u0434\u0436\u0443\u043d\u0438\u043e\u0440 \u043d\u0435 \u0443\u0431\u0435\u0440\u0435\u0442 \u0435\u0433\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043d\u0435\u0442, \u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0432\u0435\u0449\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0432 \u0445\u043e\u0434\u0435 \u043a\u043e\u0434-\u0440\u0435\u0432\u044c\u044e.<\/p>\n<p>  \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 .NET \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u0430\u043f\u0438\u0442\u044c \u0438\u0445 \u043d\u0430 \u0431\u0434. \u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0432\u044b \u0443\u043f\u0430\u0434\u0435\u0442\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0433\u0434\u0435 \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435 \u0432\u0435\u0440\u043d\u044b\u0439 email, \u0430 \u043d\u0435 \u043f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u0432 \u0411\u0414, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u043b\u0435\u043a\u043e \u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u043c\u0430\u0441\u0441\u043e\u0432\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445.<\/p>\n<pre><code>        [Key, Index(&quot;IX_Email&quot;, 1, IsUnique = true)]         public string Email         {             get { return _email; }             set             {                 if (string.IsNullOrEmpty(value))                 {                     throw new ArgumentNullException(&quot;email&quot;);                 }                  _email = value;             }         } <\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e Email, \u0442\u0430\u043a \u0447\u0442\u043e \u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0430\u0434\u0435\u0436\u043d\u043e \u0437\u0430\u0449\u0438\u0449\u0435\u043d.<br \/>  \u041c\u043d\u0435 \u0442\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u043e\u0449\u0435, \u043e\u0442\u0441\u044e\u0434\u0430 \u0432\u044b\u0442\u0435\u043a\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u2013 Code First. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043f\u0438\u0448\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u0430 \u043f\u043e\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u044e \u0430\u0432\u0442\u043e-\u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e (\u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Entity Framework) \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e \u0435\u0435.<\/p>\n<p>  \u0421 \u043c\u043e\u0435\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f, \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0437\u0430\u0437\u043e\u0440\u043d\u043e\u0433\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0443 \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043d\u0430 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 (public) \u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a, \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u043b\u0438\u0448\u043d\u0438\u0445 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 DTO \u0438 ViewModel:  <\/p>\n<pre><code>        [HttpPost]         public ActionResult Index(Lead lead)         {             if (!ModelState.IsValid)             {                 return Json(new { success = false }, JsonRequestBehavior.AllowGet);             }               \/\/\u2026 } <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0439:  <\/p>\n<ol>\n<li>\u043a\u043b\u0430\u0441\u0441 Lead \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u043d\u0435\u043c \u0430\u0433\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438<\/li>\n<li>\u0444\u043e\u0440\u043c\u0430 \u0437\u0430\u044f\u0432\u043a\u0438 \u0438\u043c\u0435\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u043b\u0430\u0441\u0441 \u043b\u0438\u0434\u0430 \u043e\u0434\u0438\u043d \u043a \u043e\u0434\u043d\u043e\u043c\u0443<\/li>\n<li>\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0437\u0430\u0449\u0438\u0449\u0435\u043d \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c Obsolete<\/li>\n<\/ol>\n<p>  \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c DTO \u0438\/\u0438\u043b\u0438 ViewModel \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c DataMapper.<\/p>\n<h2><a href=\"http:\/\/habrahabr.ru\/post\/147363\/\">\u041c\u043e\u043d\u0430\u0434\u0430 Maybe<\/a><\/h2>\n<p>\u041f\u043e\u043a\u0430 Visual Studio 2015 \u0441 \u043d\u043e\u0432\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0438\u0437 CTP, \u044d\u0442\u0430 \u043c\u043e\u043d\u0430\u0434\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u043c. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Maybe \u0432 \u043f\u0430\u0440\u0435 \u0441 JetBrains.Annotations \u0438 Possible NullReferenceException as error \u0432 R# \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 NullReferenceException \u0432 \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u0434\u0435.<br \/>  \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 NullObject \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435.<\/p>\n<h2>\u0420\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b (DDD)<\/h2>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u043e\u043b\u0435\u043c\u0438\u043a\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 DDD \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0442\u0435\u0437\u0438\u0441\u043e\u0432:  <\/p>\n<ol>\n<li>c\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u043e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e-\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0441 DDD \u0432 \u0441\u0435\u0442\u0438, \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0435<\/li>\n<li>\u0447\u0442\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u043e\u043c\u0435\u043d\u043e\u043c, \u0430 \u0447\u0442\u043e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439<\/li>\n<li>DDD \u2013 \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u043b\u0433\u043e \u0438 \u0434\u043e\u0440\u043e\u0433\u043e, \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0435\u0439 \u00ab\u043e\u043f-\u043e\u043f, \u0433\u043e\u0442\u043e\u0432 \u043a\u043e\u0434\u00bb<\/li>\n<\/ol>\n<p>  \u041f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435 <a href=\"http:\/\/www.ozon.ru\/context\/detail\/id\/5497184\/\">\u043a\u043d\u0438\u0433\u0438 \u042d\u0432\u0430\u043d\u0441\u0430<\/a> \u0441\u0442\u0430\u043b\u043e \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0432\u0442\u043e\u0440\u044b\u043c \u043a\u0440\u0443\u0442\u044b\u043c \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043e\u043c \u0432 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430, \u043f\u043e\u0441\u043b\u0435 <a href=\"http:\/\/habrahabr.ru\/post\/136049\/\">The Art of Unit Testing<\/a>. \u0417\u0430 10 \u043b\u0435\u0442 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u041f\u041e, \u044f \u0443\u0441\u043f\u0435\u043b \u043d\u0430\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u0441\u044f \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u043e\u0432\u044b\u0445 \u0431\u0430\u0437. \u0421\u043b\u0430\u0432\u0430 \u0431\u043e\u0433\u0443, \u0443\u0436\u0435 \u043d\u0430 \u0432\u0441\u0435\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445 \u0435\u0441\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 (\u0444\u0440\u0435\u0439\u043c\u043e\u0440\u043a) \u0438 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0438 \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 MVC-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0441 \u0431\u043b\u0435\u043a\u0434\u0436\u0435\u043a\u043e\u043c \u0438 \u043a\u0443\u0440\u0442\u0438\u0437\u0430\u043d\u043a\u0430\u043c\u0438.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: \u0432 \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430\u0445, helper\u2019\u0430\u0445, manager&#8217;\u0430\u0445, service&#8217;\u0430\u0445, \u0442\u0435\u043b\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432, \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445, linq-\u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445. \u0412 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0447\u0435\u0442\u043a\u043e\u0433\u043e \u0440\u0435\u0433\u043b\u0430\u043c\u0435\u043d\u0442\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e\u043c. \u042d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0446\u0435\u043b\u0443\u044e \u043a\u0443\u0447\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c:<\/p>\n<ol>\n<li>\u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0433\u0434\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u0430\u0432\u0438\u043b\u043e<\/li>\n<li>\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u043d\u044f\u0442\u043d\u043e \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u0430\u043a\u043e\u0432\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u043a\u043e\u0434\u0430 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, <\/li>\n<li>\u043a\u043e\u0434 \u0442\u044f\u0433\u043e\u0442\u0435\u0435\u0442 \u043a \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u043e\u043c\u0443 \u0441\u0442\u0438\u043b\u044e, \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u044f<\/li>\n<li>\u0435\u0441\u0442\u044c \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432 \u0434\u0432\u0443\u0445 \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u0441\u0442\u0430\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 c#-\u043a\u043e\u0434\u0435 \u0438 \u043a\u043e\u0434\u0435 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b. \u041f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0441\u043f\u043e\u043c\u043d\u044f\u0442 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u0441\u043f\u043b\u044b\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432. \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043b\u044e\u0434\u0438 \u0438 \u043d\u0435 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u043e\u043d\u0438 \u0437\u043d\u0430\u044e\u0442, \u043a\u0430\u043a \u00ab\u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u00bb. \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, manager\u2019\u044b \u0438 helper\u2019\u044b \u2013 \u043a\u043b\u0430\u0441\u0441\u044b \u0441 \u043d\u0435\u0432\u043d\u044f\u0442\u043d\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e, \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0432 God-object\u2019\u044b<\/li>\n<li>\u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0440\u0435\u0433\u043b\u0430\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u0431\u043e\u0440\u043a\u0430\u043c\u0438. \u041a\u043b\u0430\u0441\u0441\u044b \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u043b\u0435\u0433\u043a\u043e\u0439 \u0440\u0443\u043a\u0438 junior\u2019\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0447\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0432\u0435\u0431-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0441\u0431\u043e\u0440\u043a\u0438 Common.Web<\/li>\n<\/ol>\n<p>  \u041d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u044d\u0442\u043e \u0432\u044b\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432:  <\/p>\n<ol>\n<li>\u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u043f\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0444\u0443\u043b\u043b-\u0442\u0430\u0439\u043c \u0437\u0430\u043d\u044f\u0442\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0438 \u043b\u0438\u043a\u0432\u0438\u0434\u0430\u0446\u0438\u0435\u0439 \u0431\u0430\u0433\u043e\u0432<\/li>\n<li>\u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u0431\u0430\u0433\u0444\u0438\u043a\u0441\u0438\u043d\u0433 \u0438 \u043a\u043e\u0441\u0442\u044b\u043b\u0438\u043d\u0433<\/li>\n<li>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f <\/li>\n<\/ol>\n<p>  \u0414\u043b\u044f \u043c\u0435\u043d\u044f DDD \u042d\u0432\u0430\u043d\u0441\u0430 \u2013 \u044d\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u043e\u0439. DDD \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u0430\u0431\u043e\u0440 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445. \u0417\u0430\u043e\u0434\u043d\u043e \u00ab\u043f\u043e\u0436\u0435\u043d\u0438\u043c\u00bb \u0438\u0445 \u0441 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u00ab\u043c\u043e\u0434\u043d\u043e\u0439\u00bb \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0435\u0439 \u2013 CQRS.<\/p>\n<h4>\u041a\u0430\u043a \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 DDD?<\/h4>\n<p>DDD \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c \u043c\u0443\u0445\u0438 \u0434\u043e\u043c\u0435\u043d \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u2013 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u041e\u043a\u0435\u0439 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u00ab\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c\u00bb.<\/p>\n<h2>Entity<\/h2>\n<p>  <\/p>\n<pre><code>    public interface IEntity     {         string GetId();     } <\/code><\/pre>\n<p>  \u0421\u0443\u0449\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e, \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0449\u0435\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c. \u0414\u0432\u0430 \u0433\u0432\u043e\u0437\u0434\u044f \u0432 \u043c\u0435\u0448\u043a\u0435 \u2013 \u043d\u0435 Entity, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u043e\u0442 \u0434\u0440\u0443\u0433\u043e\u0433\u043e. \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0434\u043e\u043c\u0435\u043d\u0430 \u043e\u043d\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b. \u0410 \u0432\u043e\u0442 \u0412\u0430\u0441\u044f \u0438 \u041f\u0435\u0442\u044f \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0439 \u2013 Entity. \u0423 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0418\u041d\u041d (\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u043d\u0430\u043b\u043e\u0433\u043e\u043f\u043b\u0430\u0442\u0435\u043b\u044c\u0449\u0438\u043a\u0430).<\/p>\n<blockquote><p>\u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 Id \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 GUID. \u041d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u0432 \u0440\u044f\u0434\u0435 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0415\u0441\u043b\u0438 \u0432\u044b \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u043a\u0443\u043f\u0430\u043b\u0438 \u0430\u0432\u0438\u0430\u0431\u0438\u043b\u0435\u0442\u044b \u0443 \u0430\u0433\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0440\u0430, \u0442\u043e \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u043d\u043e\u043c\u0435\u0440 \u0431\u0440\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u0433\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u0431\u0440\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u0432\u0438\u0430\u043f\u0435\u0440\u0435\u0432\u043e\u0437\u0447\u0438\u043a\u0430. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u043f\u0435\u0440\u0435\u0432\u043e\u0437\u0447\u0438\u043a\u0430 \u0441\u0432\u043e\u044f \u0418\u0422-\u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u0430 \u0443 \u0430\u0433\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0440\u0430 \u2013 \u0441\u0432\u043e\u044f.<\/p><\/blockquote>\n<p>  \u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0441 \u043b\u0435\u043d\u0434\u0438\u043d\u0433 \u043f\u0435\u0439\u0434\u0436 \u0438 \u043b\u0438\u0434\u043e\u043c. \u041c\u043e\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f IEntity \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u0430\u044f \u2013 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 Id \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0438. \u042f \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043c\u0435\u0442\u043e\u0434, \u0430 \u043d\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e. \u0412\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 Lead \u043c\u0430\u043f\u044f\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u043b\u044f \u0411\u0414. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432 \u043c\u0430\u043f\u043f\u0438\u043d\u0433. \u041f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 Email, \u0430 \u043d\u0435 Id. \u0415\u0441\u043b\u0438 \u0431\u044b \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b Id \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c, \u043c\u043d\u0435 \u0431\u044b \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e Id \u043c\u0430\u043f\u0438\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u043b\u0435 Email \u0432 \u0411\u0414, \u043a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u044d\u0442\u043e \u0431\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u043c\u0438 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 (\u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0438 guid\u2019\u0430\u043c\u0438)<\/p>\n<pre><code>    public class Lead : IEntity     {         private string _email;          [Key, Index(&quot;IX_Email&quot;, 1, IsUnique = true)]         public string Email         {             get { return _email; }             set             {                 if (string.IsNullOrEmpty(value))                 {                     throw new ArgumentNullException(&quot;value&quot;);                 }                  _email = value;             }         }          public string Phone { get; set; }          public bool Processed { get; set; }          public DateTime CreatedDate { get; set; }           \/\/ IEntity Implementation         public string GetId()         {             return Email;         } <\/code><\/pre>\n<p>  \u042f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0432\u043d\u043e\u0439, \u043d\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043e\u0439, ORM Entity Framework. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b:  <\/p>\n<ol>\n<li>\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 (\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u043a\u0443\u0447\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u0442 \u043e\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0440\u0443\u0442\u0438\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430)<\/li>\n<li>\u043b\u0443\u0447\u0448\u0430\u044f \u0432 .NET \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 linq<\/li>\n<li>\u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c NHibernate<\/li>\n<li>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 DataAnnotation-\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0434\u043b\u044f \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439<\/li>\n<\/ol>\n<p>  <\/p>\n<h2>Fluent mapping VS Atribute mapping<\/h2>\n<p>\u041d\u0430 \u0432\u043a\u0443\u0441 \u0438 \u0446\u0432\u0435\u0442 \u0432\u0441\u0435 \u0444\u043b\u043e\u043c\u0430\u0441\u0442\u0435\u0440\u044b \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435. Fluent mapping \u0447\u0438\u0449\u0435 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0435 \u0442\u0430\u0449\u0438\u0442\u044c EF \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438, \u043d\u043e \u043c\u043d\u0435 \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0435\u0433\u043e \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c 2 \u043a\u043b\u0430\u0441\u0441\u0430: \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0438 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430. \u041a\u0442\u043e-\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0434\u0435\u0441\u043a\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435 SRP. \u041c\u043e\u0435 \u043c\u043d\u0435\u043d\u0438\u0435 \u2013 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043d\u0435 \u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0442\u0430\u043a\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e. \u042f \u0432\u0438\u0436\u0443 \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043b\u0438\u0448\u044c \u0432 \u0444\u043e\u0440\u043c\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u043b\u0438\u0448\u043d\u0435\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 EF, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u043b\u0435\u0433\u043a\u043e \u0432\u044b\u043f\u0438\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<h2>Persistance ignorance<\/h2>\n<p>\u0418\u0442\u0430\u043a, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0438 \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c, \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u0437 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c. \u0412 \u043f\u0440\u043e\u0441\u0442\u043e\u043d\u0430\u0440\u043e\u0434\u044c\u0435 \u044d\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f CRUD-\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438. \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 new, \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u044f \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u00ab\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439\u00bb \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u044e\u0449\u0438\u0439 \u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043c\u044b \u043e\u0431\u044a\u044f\u0432\u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 ORM \u0438 \u0437\u0430\u0449\u0438\u0442\u0438\u043b\u0438\u0441\u044c \u043e\u0442 \u0433\u0440\u044f\u0437\u043d\u044b\u0445 \u0440\u0443\u043a \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c obsolete.<br \/>  \u041a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445? \u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430: Active Record(AR) \u0438 Unit of Work(UoW). \u042f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a Active Record\u2019\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0447\u0442\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u042f\u041f AR \u0438 \u0434\u0430\u0435\u0442 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430, \u043d\u043e \u043d\u0435 \u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c. AR \u0441\u0430\u043c\u044b\u043c \u0431\u0435\u0437\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u0442 SRP, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0432\u0441\u0435\u043c Entity \u043c\u0435\u0442\u043e\u0434 Save. \u0417\u0430\u0434\u0430\u0447\u0430 Entity \u2013 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u0438 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0441\u0435\u0431\u044f \u0432 \u0411\u0414. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043c\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 \u2013 UoW.  <\/p>\n<pre><code>    public interface IUnitOfWork: IDisposable     {         void Commit();          void Save&lt;TEntity&gt;(TEntity entity)             where TEntity : class, IEntity;          void Delete&lt;TEntity&gt;(TEntity entity)             where TEntity : class, IEntity;     } <\/code><\/pre>\n<p>  \u0414\u043b\u044f EF \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 UoW \u0431\u0443\u0434\u0435\u0442 DataContext \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u0434\u043d\u0430\u043a\u043e, \u0441\u0430\u043c DataContext \u0442\u043e\u0440\u0447\u0430\u0442\u044c \u0432 \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0437\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u0442\u0443\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 EF? \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c Bounded Context, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043b\u0443\u0447\u0448\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e DataContext, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0440\u0430\u0441\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0445\u0435\u043c\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u041a\u0430\u043a \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u041e\u0441\u0442\u0430\u043b\u0430\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432. \u0418 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u00ab\u043a\u043e\u0440\u044f\u0432\u043e\u00bb. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u00ab<a href=\"http:\/\/blog.byndyu.ru\/2011\/08\/repository.html\">\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a>\u00bb.<br \/>  \u0415\u0441\u043b\u0438 \u043a\u043e\u0440\u043e\u0442\u043a\u043e, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u0442\u0430\u043a:  <\/p>\n<pre><code>public interface IRepository&lt;T&gt; { \tT GetById(int id); \tIEnumerable&lt;T&gt; GetAll(); \tbool Add(T entity); \tbool Remove(T entity); } <\/code><\/pre>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a:  <\/p>\n<pre><code>class AccountRepository : IRepository&lt;Account&gt; { \tpublic Account GetByName(string name); \tpublic Account GetByEmail(string email); \tpublic Account GetByAge(int age); \tpublic Account GetByNameAndEmail(string name, string email); \tpublic Account GetByNameOrEmail(string name, string email); \t \/\/ ... \tpublic Account GetByAreYouFuckingKiddingMe(SomeCriteria c); } <\/code><\/pre>\n<p>  \u0412\u044b \u0432\u044b\u0445\u043e\u0434\u0438\u0442\u0435 \u0438\u0437 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u043e\u0442 \u0442\u0430\u043a (\u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 extension-\u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u044f \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e, \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c, \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c \u043d\u0438\u0436\u0435):  <\/p>\n<pre><code>public interface IRepository&lt;T&gt; { \tT GetById(int id); \t\/\/\u0432\u043e \u0438\u043c\u044f \u043b\u0443\u043d\u044b \tIQueryable&lt;T&gt; Query(); \tbool Add(T entity); \tbool Remove(T entity); } <\/code><\/pre>\n<p>  \u041d\u043e \u043e\u0431\u043b\u0430\u043c\u044b\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code>\/\/ \u0431\u044b\u043b\u043e \u0442\u0430\u043a\u043e\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u0430\u0432\u0438\u043b\u043e repo.Query ().Where(a =&gt; a.IsDeleted = false);  \/\/ \u0430 \u0441\u0442\u0430\u043b\u043e \u0442\u0430\u043a\u043e\u0435, \u0438\u0449\u0438\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u0438 \u043b\u044f\u043c\u0431\u0434\u044b \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e repo.Query().Where(a =&gt; a.IsDeleted = false && a.Balance &gt; 0);  \/\/ runtime error repo.Query().Where(a =&gt; a.CreationDate &lt; getCurrentDate()); <\/code><\/pre>\n<p>  \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 linq-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u00ab\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u00bb. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0441\u0447\u0438\u0442\u0430\u043b\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043d\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435, \u0430 \u043f\u043e\u0442\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u00ab\u0431\u0430\u043b\u0430\u043d\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0443\u043b\u044f\u00bb. \u0422\u0430\u043a \u043a\u0430\u043a linq-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043a\u043e\u043f\u0438\u043f\u0430\u0449\u0435\u043d\u044b \u0432 \u0434\u0435\u0441\u044f\u0442\u043a\u0435 \u043c\u0435\u0441\u0442 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b. \u041f\u043e\u0447\u0442\u0438 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0433\u0434\u0435-\u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u044e\u0442, \u0430 \u0433\u0434\u0435-\u0442\u043e \u0437\u0430\u0431\u0443\u0434\u0443\u0442.<\/p>\n<p>  \u0422\u0440\u0435\u0442\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043d\u043e \u0433\u0440\u043e\u0445\u043d\u0435\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e ORM \u043d\u0435 \u043f\u043e\u0439\u043c\u0435\u0442 \u043a\u0430\u043a \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e getCurrentDate \u0432 SQL. \u0415\u0441\u043b\u0438 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0436\u0438\u043c\u0430\u0435\u0442, \u0430 \u0442\u0430\u0441\u043a \u0434\u043e\u0441\u0442\u0430\u043b\u0441\u044f junior\u2019\u0443, \u043e\u043d \u0431\u044b\u0441\u0442\u0440\u0435\u043d\u044c\u043a\u043e \u00ab\u0434\u043e\u043f\u0438\u043b\u0438\u0442\u00bb \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u043b\u044c\u043d\u0438\u043a\u043e\u043c \u0432\u043e\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code>repo.Query().ToEnumerable().Where(a =&gt; a.CreationDate &lt; getCurrentDate()); <\/code><\/pre>\n<p>  \u0418 \u0432\u0441\u0435 3 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u0432 \u043f\u043e\u0434\u043d\u0438\u043c\u0443\u0442\u0441\u044f \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c.<br \/>  \u0415\u0441\u0442\u044c \u0435\u0449\u0435 \u043f\u0430\u0440\u043e\u0447\u043a\u0430 \u043d\u0435\u044f\u0432\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c IQueryable \u043d\u0430\u0440\u0443\u0436\u0443:   <\/p>\n<ol>\n<li>IQueryable \u00ab\u043f\u0440\u043e\u0442\u0435\u043a\u0430\u0435\u0442\u00bb \u0438 <a href=\"http:\/\/blog.ploeh.dk\/2013\/07\/20\/linq-versus-the-lsp\">\u044f\u0432\u043d\u043e \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u0442 LSP<\/a>. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f IQueryable, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u00ab\u043f\u0435\u0440\u0435\u0432\u0430\u0440\u0438\u0442\u00bb \u043b\u044e\u0431\u044b\u0435 \u044d\u043a\u0441\u043f\u0440\u0435\u0448\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0435\u0439 \u0441\u043a\u043e\u0440\u043c\u0438\u0442\u0435 \u2013 \u044d\u0442\u043e in-memory. \u041d\u043e \u0434\u043b\u044f in-memory \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c linq2object, \u0447\u0442\u043e \u043b\u0438\u0448\u0430\u0435\u0442 IQueryable \u0432\u0441\u044f\u043a\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430. \u041b\u044e\u0431\u043e\u0439 Where-\u0437\u0430\u043f\u0440\u043e\u0441 \u2013 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043e\u0442\u043a\u0430\u0437\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430<\/li>\n<li>\u041d\u0435 \u0432\u0441\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 linq. \u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0430\u043c \u0437\u0430\u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430, \u0430 \u0441 \u043d\u0438\u043c Sphinx\u2019\u0430 \u0438\u043b\u0438 Elastic\u2019\u0430. \u042f \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u044e\u0441\u044c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u00ab\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 linq-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u00bb \u043d\u0430\u0439\u0434\u0443\u0442 \u043e\u0442\u043a\u043b\u0438\u043a \u0443 \u043c\u0435\u043d\u0435\u0434\u0436\u043c\u0435\u043d\u0442\u0430 (\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043a\u0441\u0442\u0430\u0442\u0438). \u041f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0434\u0435\u043b\u043e \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0439\u0442\u0438 \u043f\u043e \u0441\u0435\u0442\u0438, \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0438\u0441\u043a\u0435, \u0432 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438 \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u0433\u0434\u0435<\/li>\n<li>\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432 \u0446\u0435\u043b\u044f\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0434\u0435\u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043d\u0430 \u0432 NOSQL-\u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0440\u0443\u043a\u0430\u043c\u0438 \u0438 \u0442\u044e\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u043e-\u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443, \u0432 \u0442.\u0447. \u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/li>\n<\/ol>\n<p>  \u041f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435. \u042d\u0442\u043e \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043e \u0432 linq by-design. \u0418 \u0433\u0440\u0435\u0445 \u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c\u0441\u044f, linq \u2013 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e. \u041f\u0443\u043d\u043a\u0442\u044b \u0434\u0432\u0430 \u0438 \u0442\u0440\u0438 \u043a\u0430\u043a-\u0431\u0435 \u043d\u0430\u043c\u0435\u043a\u0430\u044e\u0442, \u0447\u0442\u043e IQueryable \u2014 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u043d\u0430 \u0432\u0441\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0436\u0438\u0437\u043d\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0438\u0440\u0435 \u0435\u0449\u0435 \u043d\u0435 \u0432\u0441\u0435 .NET-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441 \u043f\u043e\u043b-\u043f\u0438\u043d\u043a\u0430 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e\u0442 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u043d\u044f \u043f\u0438\u0448\u0443\u0442 \u0441\u0432\u043e\u0439 linq-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445.<br \/>  \u0425\u043e\u0440\u043e\u0448\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u0443\u0436\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 \u0437\u0430 \u043d\u0430\u0441<\/p>\n<h2>Specification aka Filter<\/h2>\n<p>  <\/p>\n<pre><code>public interface ISpecification&lt;in T&gt;         where T:IEntity     {         bool IsSatisfiedBy(T o);     }  public interface IRepository&lt;T&gt; { \tT GetById(int id); \t\/\/\u0432\u043e \u0438\u043c\u044f \u043b\u0443\u043d\u044b \tIEnumerable&lt;T&gt; GetBySpecification(ISpecification&lt;T&gt; spec); \tbool Add(T entity); \tbool Remove(T entity); } <\/code><\/pre>\n<p>  \u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u2013 \u044d\u0442\u043e \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438. \u0412\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434, \u043b\u0438\u0431\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u044e, \u043b\u0438\u0431\u043e \u2013 \u043d\u0435\u0442. \u0412 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0432\u0438\u0434\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430: \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 Linq \u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u041d\u043e, \u043f\u043e\u0437\u0432\u043e\u043b\u044c\u0442\u0435, \u0437\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e? \u041c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c IsSatisfiedBy \u0432 SQL, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437 \u0411\u0414 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u043d\u0438\u043c. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0438\u0445, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0440\u043e\u0432\u043d\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 (\u0432 \u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c).<br \/>  \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u0430\u044f \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u044f, \u0434\u0435\u0441\u043a\u0430\u0442\u044c <a href=\"http:\/\/www.minddriven.de\/index.php\/technology\/dot-net\/c-sharp\/specification-pattern-obsolete\">\u043f\u0430\u0442\u0442\u0435\u0440\u043d \u00ab\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u00bb \u0443\u0441\u0442\u0430\u0440\u0435\u043b \u0441 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c linq<\/a>.<br \/>  \u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0430\u0441\u0442\u0440\u043e\u043d\u0430\u0432\u0442\u044b \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b:  <\/p>\n<pre><code>public interface IExpressionSpecification&lt;T&gt; : ISpecification&lt;T&gt;         where T:class,IEntity {         Expression&lt;Func&lt;T, bool&gt;&gt; Expression { get; } }   public interface IRepository&lt;T&gt; { \tT GetById(int id); \t\/\/\u0432\u043e \u0438\u043c\u044f \u043b\u0443\u043d\u044b \tIEnumerable&lt;T&gt; GetBySpecification(IExpressionSpecification&lt;T&gt; spec); \tbool Add(T entity); \tbool Remove(T entity); } <\/code><\/pre>\n<p>  \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u044c \u0441\u0432\u0435\u0440\u0445-\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0442\u0435-\u0436\u0435 \u044f\u0439\u0446\u0430, \u0432\u0438\u0434 \u0432 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043d\u0435\u043d\u0443\u0436\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u043e\u0439 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0422\u0435\u043c \u0431\u043e\u043b\u0435\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f linq-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043a\u043e\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u044f\u0449\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code>public class Account : IEntity {         [BusinessRule]         public static Expression&lt;Func&lt;Lead, bool&gt;&gt; ActiveRule = x =&gt; x.IsDeleted && x.Ballance &gt; 0; } <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0412 \u0438\u0442\u043e\u0433\u0435<\/h4>\n<ol>\n<li>\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<li>linq \u2013 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043d\u0435 \u0432\u0435\u0437\u0434\u0435 \u043f\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0438\u043b\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/li>\n<\/ol>\n<h2>CQ[R]S \u2013 Command, Query [Responsibility] Segregation<\/h2>\n<p>\u0418\u043b\u0438 \u043f\u043e-\u0440\u0443\u0441\u0441\u043a\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u0438. \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043d\u0430\u0448\u0435\u043b \u0432 \u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445. \u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2013 \u0444\u0438\u0434 \u0432 \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0442\u044f\u0445: \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043a\u0443\u0447\u0438 \u0442\u0430\u0431\u043b\u0438\u0446 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u0430\u0448\u0438\u0445 \u0434\u0440\u0443\u0437\u0435\u0439 \u0438 \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0443\u0447\u0435\u0441\u0442\u044c \u043a\u0430\u043a \u0432\u0441\u0435 \u043b\u0430\u0439\u043a\u0430\u044e\u0442 \u0438 \u0440\u0435\u043f\u043e\u0441\u0442\u044f\u0442 \u0432\u0430\u0448\u0438 \u0444\u043e\u0442\u043e\u0447\u043a\u0438. \u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u2013 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0434\u0436\u043e\u0438\u043d\u043e\u0432 \u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438. <br \/>  \u041e\u0431\u044b\u0447\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2013 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a. \u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0434\u0435\u043d\u043e\u0440\u043e\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435, \u043d\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043c\u044b\u0441\u043b \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a:  <\/p>\n<ol>\n<li>\u0438\u0437\u0431\u0430\u0432\u0438\u0442\u0441\u044f \u043e\u0442 \u0434\u0436\u043e\u0438\u043d\u043e\u0432, \u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043b\u043e\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/li>\n<li>\u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a \u0447\u0442\u0435\u043d\u0438\u0435\/\u0437\u0430\u043f\u0438\u0441\u044c<\/li>\n<li>\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u00ab\u0432 \u0444\u043e\u043d\u0435\u00bb, \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/li>\n<\/ol>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430: Command \u0438 Query.<br \/>  Command \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 (CUD), \u0430 Query \u2013 \u0447\u0442\u0435\u043d\u0438\u0435 \u00ae \u0434\u0430\u043d\u043d\u044b\u0445.   <\/p>\n<pre><code>    public interface IQuery&lt;TEntity, in TSpecification&gt;         where TEntity : class, IEntity         where TSpecification : ISpecification&lt;TEntity&gt;     {         IQuery&lt;TEntity, TSpecification&gt; Where([NotNull] TSpecification specification);          IQuery&lt;TEntity, TSpecification&gt; OrderBy&lt;TProperty&gt;(            [NotNull] Expression&lt;Func&lt;TEntity, TProperty&gt;&gt; expression,            SortOrder sortOrder = SortOrder.Asc);          IQuery&lt;TEntity, TSpecification&gt; Include&lt;TProperty&gt;([NotNull] Expression&lt;Func&lt;TEntity, TProperty&gt;&gt; expression);          [NotNull]         TEntity Single();          [CanBeNull]         TEntity FirstOrDefault();          [NotNull]         IEnumerable&lt;TEntity&gt; All();          [NotNull]         IPagedEnumerable&lt;TEntity&gt; Paged(int pageNumber, int take);  \t    long Count();     }       public interface ICommand     {         void Execute();     }       public interface ICommand&lt;in T&gt;     {         void Execute(T context);     }      public interface IPagedEnumerable&lt;out T&gt; : IEnumerable&lt;T&gt;     {        long TotalCount { get; }     }      public class CreateEntityCommand&lt;T&gt; : UnitOfWorkScopeCommand&lt;T&gt;         where T: class, IEntity     {         public override void Execute(T context)         {             UnitOfWorkScope.GetFromScope().Save(context);             UnitOfWorkScope.GetFromScope().Commit();         }          public CreateEntityCommand([NotNull] IScope&lt;IUnitOfWork&gt; unitOfWorkScope)             : base(unitOfWorkScope)         {         }     }      public class DeleteEntityCommand&lt;T&gt; : UnitOfWorkScopeCommand&lt;T&gt;         where T: class, IEntity     {         public DeleteEntityCommand([NotNull] IScope&lt;IUnitOfWork&gt; unitOfWorkScope)             : base(unitOfWorkScope)         {         }          public override void Execute(T context)         {             UnitOfWorkScope.GetFromScope().Delete(context);             UnitOfWorkScope.GetFromScope().Commit();         }     } <\/code><\/pre>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u044c Query \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e (\u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438) \u0432 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430). Query \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044e \u043e\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u2013 \u043d\u0430\u043c \u043d\u0435 \u0432\u0430\u0436\u043d\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u2013 \u044d\u0442\u043e \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0439 linq+. \u0414\u043b\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0445 linq \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c ExpressionSpecification. \u0412 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 linq \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u043e (\u043d\u0435\u0442 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Elastic Search), \u0432\u044b\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c Expression\u2019\u044b \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0432\u043e\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e.   <\/p>\n<pre><code>    public interface IExpressionSpecification&lt;T&gt; : ISpecification&lt;T&gt;         where T:class,IEntity     {         Expression&lt;Func&lt;T, bool&gt;&gt; Expression { get; }     }          public static IQuery&lt;TEntity, IExpressionSpecification&lt;TEntity&gt;&gt; Where&lt;TEntity&gt;(             this IQuery&lt;TEntity, IExpressionSpecification&lt;TEntity&gt;&gt; query,             Expression&lt;Func&lt;TEntity, bool&gt;&gt; expression)             where TEntity : class, IEntity         {             return query.Where(new ExpressionSpecification&lt;TEntity&gt;(expression));         } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0430 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043b\u043e\u0436\u0438\u0442\u044c\u0441\u044f \u043d\u0430 Query.<\/p>\n<h2>ICommandFactory, IQueryFactory<\/h2>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 command \u0438 query \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0437\u0430\u043d\u044f\u0442\u0438\u0435\u043c, \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 IOC-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043f\u043e \u043a\u043e\u043d\u0432\u0435\u043d\u0448\u043d\u0430\u043c. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u0430\u0449\u0438\u0442\u044c \u0432\u0430\u0448 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0432\u043e \u0432\u0441\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c ServiceLocator, \u0432\u043e\u0437\u043b\u043e\u0436\u0438\u043c \u044d\u0442\u0443 \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u0444\u0430\u0431\u0440\u0438\u043a\u0438.  <\/p>\n<pre><code>    public interface ICommandFactory     {         TCommand GetCommand&lt;TEntity, TCommand&gt;()             where TCommand : ICommand&lt;TEntity&gt;;          T GetCommand&lt;T&gt;()             where T : ICommand;          CreateEntityCommand&lt;T&gt; GetCreateCommand&lt;T&gt;()             where T : class, IEntity;          DeleteEntityCommand&lt;T&gt; GetDeleteCommand&lt;T&gt;()             where T : class, IEntity;     }      public interface IQueryFactory     {         IQuery&lt;TEntity, IExpressionSpecification&lt;TEntity&gt;&gt; GetQuery&lt;TEntity&gt;()             where TEntity : class, IEntity;          IQuery&lt;TEntity, TSpecification&gt; GetQuery&lt;TEntity, TSpecification&gt;()             where TEntity : class, IEntity             where TSpecification : ISpecification&lt;TEntity&gt;;          TQuery GetQuery&lt;TEntity, TSpecification, TQuery&gt;()             where TEntity : class, IEntity             where TSpecification: ISpecification&lt;TEntity&gt;             where TQuery : IQuery&lt;TEntity, TSpecification&gt;;       } <\/code><\/pre>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 query \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<pre><code>_queryFactory.GetQuery&lt;Product&gt;()     .Where(Product.ActiveRule) \/\/ \u044d\u0442\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u044d\u043a\u0441\u043f\u0440\u0435\u0448\u043d, \u043a\u0430\u043a \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441 Account. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f ExpressionSpecification     .OrderBy(x =&gt; x.Id)     .Paged(0, 10) \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c 10 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b  \/\/ \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 ElasticSearch, \u043d\u0435 \u0432\u043e\u043f\u0440\u043e\u0441: _queryFactory.GetQuery&lt;Product, FullTextSpecification&gt;()     .Where(new FullTextSpecification(\u00ab\u0437\u043e\u043d\u0442\u0438\u043a\u00bb))     .All()  \/\/ \u0418\u043b\u0438 EF \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442 \u0438 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u0445\u0440\u0430\u043d\u0438\u043c\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0438 Dapper _queryFactory.GetQuery&lt;Product, DictionarySpecification, DapperQuery&gt;()     .Where(new DictionarySpecification (someDirctionary))     .All() <\/code><\/pre>\n<p>  \u0412\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442-\u0436\u0435 \u043a\u043e\u0434, \u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f _queryFactory.GetQuery&lt;Product, DictionarySpecification, DapperQuery&gt;() \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u043c \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f. \u042d\u0442\u0430 \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432 \u043a\u043e\u0434\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0445\u043e\u0434\u0435 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043f\u0438\u0441\u0430\u043b\u0430 \u043d\u0430 ORM, \u0440\u0430\u0434\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0415\u0441\u043b\u0438 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0435\u0441\u0442\u044c \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0432 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 linq (\u0445\u043e\u0442\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u044d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c).<br \/>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 _queryFactory.GetQuery&lt;Product, FullTextSpecification&gt;() \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u00ab\u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0443\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e\u00bb, \u043e\u0434\u043d\u0430\u043a\u043e \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u2013 ElasticSearchQuery. \u0414\u043b\u044f \u043d\u0435\u0433\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u00ab\u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0438\u0441\u043a\u00bb. <\/p>\n<p>  \u041f\u043e\u043b\u0435\u043c\u0438\u043a\u0430 \u043d\u0430 \u0442\u0435\u043c\u0443: <a href=\"http:\/\/habrahabr.ru\/post\/125720\/\">habrahabr.ru\/post\/125720<\/a><\/p>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0430\u0445\u0430\u0440\u0430<\/h2>\n<p>\u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443:  <\/p>\n<pre><code>public class Account : IEntity {         [BusinessRule]         public static Expression&lt;Func&lt;Lead, bool&gt;&gt; ActiveRule = x =&gt; x.IsDeleted && x.Ballance &gt; 0;         bool IsActive()        {              \/\/ \u043a\u0430\u043a \u043d\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0437\u0434\u0435\u0441\u044c???        } } <\/code><\/pre>\n<p>  \u0411\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u0430\u0432\u0438\u043b\u043e \u00ab\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u00bb \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043b\u043e\u0433\u0438\u0447\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u043e\u044f\u0442\u044c\u0441\u044f, \u0440\u0430\u0437\u0431\u0440\u043e\u0441\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u043b\u044f\u043c\u0431\u0434. <br \/>  \u0418\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0443\u0436\u043d\u043e \u0432 \u0432\u0438\u0434\u0435 Expression&lt;Func&lt;Lead, bool&gt;&gt; \u2014 \u0434\u043b\u044f \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0432 \u0432\u0438\u0434\u0435 Func&lt;Lead, bool&gt;&gt; \u2014 \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432, \u0432\u0440\u043e\u0434\u0435 IsActive. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0438\u0445 \u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0438\u0434\u0435\u0435\u0439. \u041a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e:  <\/p>\n<pre><code>    public static class Extensions     {         private static readonly ConcurrentDictionary&lt;Expression, object&gt; _cachedFunctions              = new ConcurrentDictionary&lt;Expression, object&gt;();                  public static Func&lt;TEntity, bool&gt; AsFunc&lt;TEntity&gt;(this object entity, Expression&lt;Func&lt;TEntity, bool&gt;&gt; expr)             where TEntity: class, IEntity         {             if (!_cachedFunctions.ContainsKey(expr))             {                 _cachedFunctions[expr] = expr.Compile();             }              return (Func&lt;TEntity, bool&gt;) _cachedFunctions[expr];         }          public static bool Is&lt;TEntity&gt;(this TEntity entity, Expression&lt;Func&lt;TEntity, bool&gt;&gt; expr)             where TEntity: class, IEntity         {             return AsFunc(entity, expr).Invoke(entity);         }          public static IQuery&lt;TEntity, IExpressionSpecification&lt;TEntity&gt;&gt; Where&lt;TEntity&gt;(             this IQuery&lt;TEntity, IExpressionSpecification&lt;TEntity&gt;&gt; query,             Expression&lt;Func&lt;TEntity, bool&gt;&gt; expression)             where TEntity : class, IEntity         {             return query                 .Where(new ExpressionSpecification&lt;TEntity&gt;(expression));         } }      public class ExpressionSpecification&lt;T&gt; : IExpressionSpecification&lt;T&gt;         where T:class,IEntity     {         public Expression&lt;Func&lt;T, bool&gt;&gt; Expression { get; private set; }          private Func&lt;T, bool&gt; _func;          private Func&lt;T, bool&gt; Func         {             get             {                 return this.AsFunc(Expression);             }         }          public ExpressionSpecification([NotNull] Expression&lt;Func&lt;T, bool&gt;&gt; expression)         {             if (expression == null) throw new ArgumentNullException(&quot;expression&quot;);             Expression = expression;         }          public bool IsSatisfiedBy(T o)         {             return Func(o);         }     }  public class Account : IEntity {         [BusinessRule]         public static Expression&lt;Func&lt;Lead, bool&gt;&gt; ActiveRule = x =&gt; x.IsDeleted && x.Ballance &gt; 0;          bool IsActive()         {               this.Is(ActiveRule);        } } <\/code><\/pre>\n<p>  <\/p>\n<h2>\u0410 \u0433\u0434\u0435 Service\u2019\u044b, Manager&#8217;\u044b \u0438 Helper\u2019\u044b?<\/h2>\n<p>\u041f\u0440\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 helper\u2019\u043e\u0432 \u0432 \u0434\u043e\u043c\u0435\u043d\u0435 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432 \u0441\u043b\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0447\u0442\u043e-\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0435\u0441\u0442\u044c. Manager \u0438 Service \u2013 \u0441\u0443\u0442\u044c \u043e\u0434\u043d\u043e \u0438 \u0442\u043e\u0436\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 Manager \u043b\u0443\u0447\u0448\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. Service \u2013 \u044d\u0442\u043e \u0447\u0438\u0441\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0442\u0435\u0440\u043c\u0438\u043d. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Service \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0444\u0438\u043a\u0441 \u0438\u043b\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0432\u043e\u0432\u0441\u0435 (\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e namespace \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f\u043c \u0432 IOC). <br \/>  \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0431\u0438\u0437\u043d\u0435\u0441\u0435 \u043d\u0435\u0442 \u00ab\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432\u00bb, \u0435\u0441\u0442\u044c \u00ab\u043a\u0430\u0441\u0441\u044b\u00bb, \u00ab\u043f\u0440\u043e\u0432\u043e\u0434\u043a\u0438\u00bb, \u00ab\u043a\u0432\u043e\u0442\u044b\u00bb \u0438 \u0432\u0441\u044f\u043a\u043e\u0435 \u0442\u0430\u043a\u043e\u0435. \u0422\u0430\u043a \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448\u0443 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u0438 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u044b \u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u0434\u043e\u043c\u0435\u043d\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043c\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u0414\u043b\u044f CRUD-\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b. \u0421\u0432\u044f\u0437\u043a\u0438 UoW+Command+Query+Specification+Validator \u0445\u0432\u0430\u0442\u0438\u0442, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043a\u0440\u044b\u0442\u044c 90% \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u0443\u0447\u0435\u0442\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c. \u041a\u0441\u0442\u0430\u0442\u0438, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u00ab\u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0439\u00bb. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f:  <\/p>\n<ol>\n<li>\u043a\u0432\u0430\u043b\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432: \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0437\u043d\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b<\/li>\n<li>\u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0434 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b (\u043c\u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0447\u0442\u0438 4 \u0434\u043d\u044f \u0444\u0443\u043b\u043b-\u0442\u0430\u0439\u043c \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0438\u0437 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043e\u0442\u0432\u044f\u0437\u0430\u0442\u044c \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0439 \u0438 \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u043e\u0439, \u043f\u043e\u0434 \u043d\u043e\u0436 \u043f\u043e\u0448\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430)<\/li>\n<li>\u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0430 \u0441\u0431\u043e\u0440\u043a\u0430 \u0435\u0449\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 \u0440\u0443\u043a\u0430\u0445 \u043d\u0435\u0442 \u043c\u0435\u0442\u0440\u0438\u043a \u0438 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0439 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0434\u0430\u0435\u0442 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u0438 (\u0445\u043e\u0442\u044f \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e, \u044f \u0432 \u044d\u0442\u043e\u043c \u0443\u0432\u0435\u0440\u0435\u043d \u043d\u0430 \u0432\u0441\u0435 100%)<\/li>\n<\/ol>\n<p>  <\/p>\n<h4>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430<\/h4>\n<p>  <\/p>\n<ol>\n<li>\u0447\u0435\u0442\u043a\u043e\u0435 \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043c\u0435\u043d\u0430 \u043e\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/li>\n<li>\u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430 \u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430, \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0440\u0443\u0442\u0438\u043d\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0439, \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439<\/li>\n<li>\u0440\u0435\u0433\u043b\u0430\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u0438 \u043e\u0431\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/li>\n<li>\u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 repair-kit \u0434\u043b\u044f \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0432 \u0447\u0443\u0436\u0438\u0435 \u043a\u043e\u0434\u043e\u0432\u044b\u0435 \u0431\u0430\u0437\u044b<\/li>\n<li>\u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/li>\n<\/ol>\n<p>  <em>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442&#8230;<\/em>     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/259829\/\"> http:\/\/habrahabr.ru\/post\/259829\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t<img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ca3\/b34\/8d0\/ca3b348d0d76405e94b08186043afb08.jpg\"\/>  <\/p>\n<blockquote><p>\u0422\u0440\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u044c \u043f\u043e\u043b\u0435, \u0438 \u0434\u043e\u0439\u0442\u0438 \u0434\u043e \u0434\u043e\u043c\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442-\u043d\u043e\u0432\u0438\u0447\u043e\u043a \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u043a\u043e\u0440\u043e\u0442\u043a\u0443\u044e \u0434\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u044e \u0438 \u0441\u043a\u0430\u0437\u0430\u043b, \u00ab\u042d\u0442\u043e \u043d\u0435 \u0434\u0430\u043b\u0435\u043a\u043e! \u042d\u0442\u043e \u0437\u0430\u0439\u043c\u0435\u0442 \u0443 \u043c\u0435\u043d\u044f \u0434\u0435\u0441\u044f\u0442\u044c \u043c\u0438\u043d\u0443\u0442\u00bb. \u041e\u043f\u044b\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u043f\u043e\u043b\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0438 \u0441\u043a\u0430\u0437\u0430\u043b: \u00ab\u042f \u043c\u043e\u0433 \u0431\u044b \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0442\u0443\u0434\u0430 \u0437\u0430 \u0434\u0435\u043d\u044c\u00bb. \u041d\u043e\u0432\u0438\u0447\u043e\u043a \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u043d\u0435\u0433\u043e \u0441 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435\u043c. \u0413\u0443\u0440\u0443-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u043f\u043e\u043b\u0435 \u0438 \u0441\u043a\u0430\u0437\u0430\u043b. \u00ab\u041a\u0430\u0436\u0435\u0442\u0441\u044f \u043c\u0438\u043d\u0443\u0442 \u0434\u0435\u0441\u044f\u0442\u044c, \u043d\u043e \u044f \u0434\u0443\u043c\u0430\u044e \u043f\u044f\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u00bb. \u041e\u043f\u044b\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0440\u0430\u0441\u0441\u043c\u0435\u044f\u043b\u0441\u044f.<\/p>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442-\u043d\u043e\u0432\u0438\u0447\u043e\u043a \u0434\u0432\u0438\u043d\u0443\u043b\u0441\u044f \u0432 \u043f\u0443\u0442\u044c, \u043d\u043e \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u0438\u0439, \u043d\u0430\u0447\u0430\u043b\u0438 \u0432\u0437\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0438\u043d\u044b, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043f\u043e\u0441\u043b\u0435 \u0441\u0435\u0431\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u044f\u043c\u044b. \u041e\u0442 \u0432\u0437\u0440\u044b\u0432\u043e\u0432 \u043e\u043d \u043e\u0442\u043b\u0435\u0442\u0430\u043b \u043d\u0430\u0437\u0430\u0434, \u0438 \u0435\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043d\u043e\u0432\u0430 \u0438 \u0441\u043d\u043e\u0432\u0430. \u0423 \u043d\u0435\u0433\u043e \u0443\u0448\u043b\u043e \u0434\u0432\u0430 \u0434\u043d\u044f \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u0446\u0435\u043b\u0438. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043e\u043d \u0432\u0435\u0441\u044c \u0442\u0440\u044f\u0441\u0441\u044f \u0438 \u0431\u044b\u043b \u0440\u0430\u043d\u0435\u043d, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0448\u0435\u043b.<\/p>\n<p>  \u041e\u043f\u044b\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u043e\u043f\u043e\u043b\u0437 \u043d\u0430 \u0447\u0435\u0442\u0432\u0435\u0440\u0435\u043d\u044c\u043a\u0430\u0445. \u041e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e \u0449\u0443\u043f\u0430\u044f \u0437\u0435\u043c\u043b\u044e \u0438 \u0438\u0449\u0430 \u043c\u0438\u043d\u044b, \u0434\u0432\u0438\u0433\u0430\u044f\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0431\u044b\u043b \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e. \u041c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0438 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e \u043e\u043d \u043f\u0435\u0440\u0435\u0441\u0435\u043a \u043f\u043e\u043b\u0435 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u043d\u044f. \u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0434\u0435\u0432 \u043f\u0430\u0440\u0443 \u043c\u0438\u043d.<\/p>\n<p>  \u0413\u0443\u0440\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f \u0432 \u043f\u0443\u0442\u044c, \u0438 \u043f\u043e\u0448\u0435\u043b \u043f\u0440\u044f\u043c\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u043b\u0435. \u0426\u0435\u043b\u0435\u0443\u0441\u0442\u0440\u0435\u043c\u043b\u0435\u043d\u043d\u043e \u0438 \u043f\u0440\u044f\u043c\u043e. \u041e\u043d \u0434\u043e\u0441\u0442\u0438\u0433 \u0446\u0435\u043b\u0438 \u0432\u0441\u0435\u0433\u043e \u0437\u0430 \u0434\u0435\u0441\u044f\u0442\u044c \u043c\u0438\u043d\u0443\u0442.<br \/>  \u00ab\u041a\u0430\u043a \u0442\u0435\u0431\u0435 \u044d\u0442\u043e \u0443\u0434\u0430\u043b\u043e\u0441\u044c?\u00bb \u2014 \u0441\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u0434\u0432\u043e\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u2014 \u00ab\u041a\u0430\u043a \u0442\u044b \u0443\u043c\u0443\u0434\u0440\u0438\u043b\u0441\u044f \u043d\u0435 \u0437\u0430\u0446\u0435\u043f\u0438\u0442\u044c \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u043c\u0438\u043d\u044b?\u00bb<br \/>  \u00ab\u041b\u0435\u0433\u043a\u043e.\u00bb \u2014 \u043e\u0442\u0432\u0435\u0442\u0438\u043b \u043e\u043d. \u00ab\u042f \u043d\u0435 \u0437\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043b \u043c\u0438\u043d\u044b \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u043f\u0443\u0442\u0438\u00bb.  <\/p><\/blockquote>\n<p>  \u041a\u0430\u043a \u043d\u0438 \u043f\u0440\u0438\u0441\u043a\u043e\u0440\u0431\u043d\u043e, \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c \u2013 \u043c\u044b \u0441\u0430\u043c\u0438 \u0437\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0441\u0435\u0431\u0435 \u043c\u0438\u043d\u044b. \u0412 <a href=\"http:\/\/habrahabr.ru\/post\/233221\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0440\u0438\u0441\u043a\u0438 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u041f\u041e \u0438 \u043e\u043f\u0438\u0441\u0430\u043b \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043e\u0441\u043b\u0430\u0431\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0440\u0438\u0441\u043a\u043e\u0432. \u0417\u0430 \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0439 \u0433\u043e\u0434 \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043c\u044b\u0441\u043b \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443: \u00ab\u0432\u0441\u0435 \u043a\u0440\u0443\u0442\u043e, \u043d\u043e \u0441 \u0447\u0435\u0433\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0438 \u043a\u0430\u043a \u0432\u0441\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0438\u0440\u0435\u00bb. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043d\u043e\u0441\u0438\u0442 \u0441\u043a\u043e\u0440\u0435\u0435 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441\u0441\u044b\u043b\u043e\u043a. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-258924","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/258924","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=258924"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/258924\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=258924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=258924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=258924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}