{"id":259765,"date":"2015-06-21T03:03:02","date_gmt":"2015-06-20T23:03:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=259765"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=259765","title":{"rendered":"\u041f\u0440\u043e\u0433\u043d\u043e\u0437 \u043d\u0430 Specification pattern \u0432 Domain layer \u2014 \u043e\u0436\u0438\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b"},"content":{"rendered":"<p>     \t<b>Data Access Layer<\/b> \u2013 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0431\u043e\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u043c.<br \/>  \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0441\u043b\u043e\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u2013 \u044d\u0442\u043e \u043d\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u041f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0435\u0434\u0438\u043d\u0438\u0446\u044b.<br \/>  \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 Repository \u2014 DAL?<br \/>  \u0412\u043e\u0442 \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 MS <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/ff649690.aspx\">msdn.microsoft.com\/en-us\/library\/ff649690.aspx<\/a><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/111\/aba\/3ee\/111aba3ee5611cca5466dd4a6b28291a.png\" alt=\"image\"\/><br \/>  \u0410 \u0432\u043e\u0442 \u0438 \u043c\u0435\u0441\u0442\u043d\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b <a href=\"http:\/\/habrahabr.ru\/post\/52173\/\">habrahabr.ru\/post\/52173<\/a><br \/>  \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0435. <br \/>  \u041d\u043e \u043a\u043e\u0433\u0434\u0430 \u044f \u0432\u0438\u0436\u0443<\/p>\n<blockquote><p> \u00ab\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u2013 \u044d\u0442\u043e \u0444\u0430\u0441\u0430\u0434 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.\u00bb<\/p><\/blockquote>\n<p>\u2026<a name=\"habracut\"><\/a><br \/>  \u042f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u0434\u0435\u043b\u0435\u043d\u0438\u0435 <b>Domain Laye<\/b>r \u2013 <b>Repository<\/b> \u2013<b> Storage Laye<\/b>r (\u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u044b)<br \/>  \u0423\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0438 \u0441\u043b\u043e\u0435\u0432  <\/p>\n<h5>Domain Layer<\/h5>\n<p>  <\/p>\n<h6>Aggregation root<\/h6>\n<p> \u2014 <a href=\"http:\/\/martinfowler.com\/bliki\/DDD_Aggregate.html\">martinfowler.com\/bliki\/DDD_Aggregate.html<\/a> (\u043f\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u043c\u0443 \u2014 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u043d\u0430\u0435\u0442 Repository)  <\/p>\n<h6>Query<\/h6>\n<p> (\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e \u043d\u0435\u043c \u0440\u0435\u0447\u044c) \u2013 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u041f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438  <\/p>\n<h5>Repository<\/h5>\n<p>  \u0415\u0433\u043e \u0432\u0435\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e <\/p>\n<h6>Repository<\/h6>\n<p> \u2014 <a href=\"http:\/\/martinfowler.com\/eaaCatalog\/repository.html\">martinfowler.com\/eaaCatalog\/repository.html<\/a>  <\/p>\n<h6>Mapper<\/h6>\n<p> \u2014 <a href=\"http:\/\/martinfowler.com\/eaaCatalog\/mapper.html\">martinfowler.com\/eaaCatalog\/mapper.html<\/a> (\u0437\u043d\u0430\u0435\u0442 \u043a\u0430\u043a \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c Storage entity \u0432 Aggregation root \u0438 \u043d\u0430 \u043e\u0431\u043e\u0440\u043e\u0442)  <\/p>\n<h6>UoW<\/h6>\n<p> \u2014 <a href=\"http:\/\/martinfowler.com\/eaaCatalog\/unitOfWork.html\">martinfowler.com\/eaaCatalog\/unitOfWork.html<\/a> (\u0431\u0435\u0437 \u044d\u0442\u043e\u0439 \u0448\u0442\u0443\u043a\u0438, \u043d\u0435\u0442 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0443, \u0430 \u0441 \u043d\u0435\u0439 \u0435\u0441\u0442\u044c)  <\/p>\n<h5>Storage Layer<\/h5>\n<p>  <\/p>\n<h6>Storage entity<\/h6>\n<p> \u2013 \u043e\u0431 \u044d\u0442\u043e\u043c \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u043d\u0435 \u0441\u043a\u0430\u0436\u0435\u0448\u044c.<br \/>  \u0418 \u0442\u0430\u043a DAL \u044d\u0442\u043e 6 (5 \u0435\u0441\u043b\u0438 Mapper \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c\u044e Repository) \u0431\u043b\u043e\u043a\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0433\u0440\u0430\u0435\u0442 \u0432\u0430\u0436\u043d\u0443\u044e \u0440\u043e\u043b\u044c.<br \/>  \u0417\u0430\u043f\u0440\u043e\u0441 \u2013 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u043c\u0443 \u0432 Repository \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0438\u0434\u0435\u044f Specification <a href=\"http:\/\/www.codeproject.com\/Articles\/670115\/Specification-pattern-in-Csharp\">www.codeproject.com\/Articles\/670115\/Specification-pattern-in-Csharp<\/a> \u0422\u0430\u043a \u0436\u0435 \u0435\u0441\u0442\u044c <a href=\"http:\/\/habrahabr.ru\/post\/171559\/\">habrahabr.ru\/post\/171559<\/a>.<br \/>  \u0424\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u2013 \u0440\u0430\u0431\u043e\u0442\u0430 \u0442\u0430\u043a \u0441\u0435\u0431\u0435, \u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0448\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c  <\/p>\n<pre><code class=\"cs\">query  = CarSpecifications.ByMark( mark ).                  And( CarSpecifications.ByColor( color ).Not() ) ; cars = carRepository.Get(query); <\/code><\/pre>\n<p>  \u041f\u043e\u043d\u0438\u043c\u0430\u0435\u0448\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u043e\u0433\u043e \u0441\u0442\u043e\u0438\u043b\u043e. \u0427\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430, \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432 CarSpecifications.<br \/>  \u041e\u0441\u043e\u0431\u043e \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439  <\/p>\n<blockquote><p>\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 x=&gt;x.GroupName == groupName \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0438 \u0437\u0430\u0441\u0443\u043d\u044c\u0442\u0435 \u0435\u0433\u043e \u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434-\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0441 \u0433\u043e\u0432\u043e\u0440\u044f\u0449\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c:<\/p>\n<pre><code class=\"cs\">public class UserQueryExtensions  {    public static IQueryable&lt;User&gt; WhereGroupNameIs(this IQueryable&lt;User&gt; users, strin name)     {        return users.Where(u =&gt; u.GroupName == name);    } } <\/code><\/pre>\n<p>  \u0412 10 \u0440\u0430\u0437 \u043c\u0435\u043d\u044c\u0448\u0435 \u043a\u043e\u0434\u0430, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u043e\u0442 \u0436\u0435.<\/p><\/blockquote>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043d\u0443 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b Or \u0438 Not. \u041d\u0443 \u0438 \u0441\u0442\u0430\u0442\u0438\u043a\u0430 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0442 DI.<br \/>  \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u0435\u043d. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u044b \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f (\u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0430 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <br \/>  new ExpressionSpecification(o =&gt; o.BrandName == BrandName.Samsung);)<br \/>  \u041a\u0440\u0435\u0441\u0442\u044b, \u044d\u0442\u043e \u043e\u0442\u043a\u0430\u0442 \u043a \u0442\u043e\u043c\u0443 \u043e\u0442 \u0447\u0435\u0433\u043e Repository \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c.) <br \/>  \u043c\u043e\u0436\u043d\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b. <br \/>  \u0424\u0438\u043b\u044c\u0442\u0440\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 (\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u0430\u043a \u0436\u0435 \u0438 Aggregation root).<br \/>  \u0418 \u0432\u0441\u0435 \u0431\u044b \u0431\u044b\u043b\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u0442\u0430\u043a \u0443\u0436\u0430\u0441\u043d\u043e. \u0422\u043e \u0438\u0437 \u0437\u0430 \u0447\u0435\u0433\u043e \u044f <b>\u041d\u0415\u041d\u0410\u0412\u0418\u0416\u0423<\/b> \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2013 \u0441\u0443\u0440\u043e\u0432\u0443\u044e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u043d\u0443\u044e \u0432 \u043d\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u0435 \u0441\u0438\u0441\u0442\u0435\u043c. Specification \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442\u043e\u043c \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, <br \/>  \u0443\u0432\u044b \u0438 \u0430\u0445, \u043a\u0430\u043a Repository \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u0442 ISpecification&lt;D&gt; \u0432 Predicate&lt;S&gt; \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u0435\u0433\u043e \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0445 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430?<br \/>   \u0414\u0430 \u043d\u0438 \u043a\u0430\u043a. <br \/>  \u041d\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e S \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c S -&gt; D (\u043c\u0430\u043f\u043f\u0438\u043d\u0433) \u0438 \u0443\u0436\u0435 \u043a D \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e. \u0418 \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a \u043e\u043f\u044f\u0442\u044c \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u0441\u0443\u0440\u043e\u0432\u0430\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u0430\u0435\u0442, \u0434\u0438\u043a\u0442\u0443\u044f \u0432\u0441\u0435 \u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u0435\u0433\u0440\u0430\u0434\u044b. <br \/>  \u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043a\u0432\u0435\u0441\u0442\u0430: \u0435\u0441\u0442\u044c \u0431\u0434, \u0432 \u043d\u0435\u0439 \u0436\u0438\u0432\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 50\u043a \u0437\u0430\u043f\u0438\u0441\u0435\u0439. <br \/>  \u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e S, GetAll\u2026 \u0432\u044b \u043d\u0435 \u043e\u0448\u0438\u0431\u043b\u0438\u0441\u044c OutOfMemory.   <\/p>\n<blockquote><p>\u041f\u043e\u0434\u043f\u043e\u043b\u0437 \u043c\u0443\u0440\u0430\u0432\u0435\u0439 \u043a \u0436\u0434 \u043f\u0443\u0442\u044f\u043c, \u0438 \u0440\u0435\u0448\u0438\u043b \u00ab\u0443\u043c\u043d\u044b\u0439 \u0432 \u0433\u043e\u0440\u0443 \u043d\u0435 \u043f\u043e\u0439\u0434\u0435\u0442, \u0443\u043c\u043d\u044b\u0439 \u0433\u043e\u0440\u0443 \u043e\u0431\u043e\u0439\u0434\u0435\u0442, \u044f \u0436 \u043d\u0435 \u0434\u0443\u0440\u0430\u043a\u00bb.<\/p><\/blockquote>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u043c\u0443\u0440\u0430\u0432\u044c\u044f \u0442\u0430\u043a \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0438 \u043d\u0435 \u043d\u0430\u0448\u043b\u0438. \u0418\u0434\u0435\u043c \u043f\u043e \u043c\u0435\u0442\u043e\u0434\u0443 \u043c\u0443\u0440\u0430\u0432\u044c\u044f, \u0431\u043e\u0440\u0435\u043c\u0441\u044f \u0441 \u0441\u0443\u0440\u043e\u0432\u043e\u0439 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e 1 \u043e\u0431\u044a\u0435\u043a\u0442\u0443   <\/p>\n<blockquote><p>\uf0e8 1 S, S -&gt; D, IsSatisfiedBy( D )<br \/>  \uf0e8 2 S, S -&gt; D, IsSatisfiedBy( D )<br \/>  \uf0e8 3 S, S -&gt; D, IsSatisfiedBy( D )<br \/>  \uf0e8 K<br \/>  \uf0e8 50000 S, S -&gt; D, IsSatisfiedBy( D )<\/p><\/blockquote>\n<p>  \u041f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438 <br \/>  50\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0431\u0434 + 50\u043a \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f + 50\u043a * n \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0435, \u0438 \u0432\u0441\u0435 \u044d\u0442\u043e = <b>\u0411\u0415\u0421\u041a\u041e\u041d\u0415\u0427\u041d\u041e\u0421\u0422\u0418<\/b><br \/>  (\u043a\u043b\u0438\u0435\u043d\u0442 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0435 \u0434\u043e\u0436\u0434\u0435\u0442\u0441\u044f, \u0432 \u043b\u0443\u0447\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u043c\u0440\u0435\u0442 \u043e\u0442 \u0441\u0442\u0430\u0440\u043e\u0441\u0442\u0438, \u0432 \u0445\u0443\u0434\u0448\u0435\u043c \u0443\u0439\u0434\u0435\u0442 \u043a \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u0430\u043c) \u0438 \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0430\u0434\u0438 \u043f\u0430\u0440\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0449\u0438\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e \u043f\u043e\u0438\u0441\u043a\u0430 (\u0437\u0430 \u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0435\u0441\u043b\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e SQL \u043d\u0435 \u0443\u043c\u0440\u0435\u0442 \u043e\u0442 Dos \u043f\u043e\u043a\u0443\u0448\u0435\u043d\u0438\u044f).<br \/>  \u042d\u0442\u043e \u043a\u043e\u043d\u0435\u0446? <br \/>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u043d\u0435\u0442, \u043f\u0440\u043e\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0431\u0434 \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0440\u0446\u0438\u044f\u043c\u0438, \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u043f\u043e m \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438 <br \/>  50\u043a \/ m \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0431\u0434 + 50\u043a \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f + 50\u043a * n \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0435, \u0447\u0442\u043e \u0442\u0430\u043a \u0436\u0435 = <b>\u0411\u0415\u0421\u041a\u041e\u041d\u0415\u0427\u041d\u041e\u0421\u0422\u0418<\/b>.<\/p>\n<p>  \u042f \u0438\u0441\u0441\u044f\u043a, \u044f \u043f\u0435\u0440\u0435\u0441\u043e\u0445, \u044f \u0441\u0434\u0430\u043b\u0441\u044f.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0441\u0443\u0440\u043e\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 \u043b\u0438\u0446\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u043d\u0435\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u0430 \u0441\u0438\u0441\u0442\u0435\u043c \u0432\u0441\u0435 \u0436 \u043e\u0434\u043e\u043b\u0435\u043b\u0430. \u042f\u0440\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0433\u0434\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0441\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u2026 \u041d\u0430 \u0444\u043e\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0432 \u0440\u0435\u0430\u043b\u0435 \u043d\u0435 \u043e\u0441\u043e\u0431\u043e (\u044d\u0442\u043e \u043c\u044f\u0433\u043a\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e).<\/p>\n<h4><b>P.S.<\/b><\/h4>\n<p>  \u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043d\u0430\u0431\u043e\u0440\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0435\u0441\u043b\u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043c\u043d\u043e\u0433\u043e \u0438 GetAll S, S -&gt; D \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u044d\u0448 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c IsSatisfiedBy( D ).     \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\/260771\/\"> http:\/\/habrahabr.ru\/post\/260771\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t<b>Data Access Layer<\/b> \u2013 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0431\u043e\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u043c.<br \/>  \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0441\u043b\u043e\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u2013 \u044d\u0442\u043e \u043d\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u041f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0435\u0434\u0438\u043d\u0438\u0446\u044b.<br \/>  \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 Repository \u2014 DAL?<br \/>  \u0412\u043e\u0442 \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 MS <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/ff649690.aspx\">msdn.microsoft.com\/en-us\/library\/ff649690.aspx<\/a><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/111\/aba\/3ee\/111aba3ee5611cca5466dd4a6b28291a.png\" alt=\"image\"\/><br \/>  \u0410 \u0432\u043e\u0442 \u0438 \u043c\u0435\u0441\u0442\u043d\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b <a href=\"http:\/\/habrahabr.ru\/post\/52173\/\">habrahabr.ru\/post\/52173<\/a><br \/>  \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0435. <br \/>  \u041d\u043e \u043a\u043e\u0433\u0434\u0430 \u044f \u0432\u0438\u0436\u0443<\/p>\n<blockquote><p> \u00ab\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u2013 \u044d\u0442\u043e \u0444\u0430\u0441\u0430\u0434 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.\u00bb<\/p><\/blockquote>\n<p>\u2026<\/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-259765","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/259765","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=259765"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/259765\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=259765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=259765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=259765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}