{"id":275575,"date":"2016-03-06T11:16:02","date_gmt":"2016-03-06T08:16:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=275575"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=275575","title":{"rendered":"\u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0431\u043b\u043e\u0433 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Asp .Net MVC, Nhibernate \u0438 Nineject.\u0427\u0430\u0441\u0442\u044c 1"},"content":{"rendered":"\n<ol>\n<li>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439: \u0447\u0442\u0435\u043d\u0438\u0435 \u043a\u043d\u0438\u0433, \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u044f\u0445, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435. \u042f \u0441\u0447\u0438\u0442\u0430\u044e \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043b\u0443\u0447\u0448\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u0437\u0443\u0447\u0430\u0435\u043c\u043e\u0439 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438. \u0411\u043b\u043e\u0433 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0435\u0433\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u0412 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439, \u043c\u044b \u0438\u0437\u0443\u0447\u0438\u043c ASP.NET MVC, \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c, \u043f\u0443\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043b\u043e\u0433\u0430 \u0441 \u043d\u0443\u043b\u044f.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/disqus.com\/\">Disqus<\/a>. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u0441.<\/p>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c ASP.NET MVC 4. \u042f \u043d\u0435 \u0441\u0438\u043b\u0435\u043d \u0432 Entity Framework \u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Fluent NHibernate\/NHibernate \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c (DAL). \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f, \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Entity Framework. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0434\u043b\u044f \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Ninject \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435.<\/p>\n<ul>\n<li>\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0431\u043b\u043e\u0433\u0430. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c.<\/li>\n<li>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b, \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0431\u043b\u043e\u0433, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c \u0438\u043b\u0438 \u0442\u0435\u0433\u0430\u043c \u0438 \u0434\u0430\u0436\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f (\u043f\u043e\u0441\u0442\u044b).<\/li>\n<li>\u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u0430\u043c\u0438, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c\u0438 \u0438 \u0442\u0435\u0433\u0430\u043c\u0438.<\/li>\n<li>\u0412 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0432\u043d\u0435\u0434\u0440\u0438\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 <a href=\"https:\/\/disqus.com\/\">Disqus<\/a> \u0432 \u043d\u0430\u0448 \u0431\u043b\u043e\u0433. \u0422\u0430\u043a\u0436\u0435, \u043c\u044b \u0432\u043d\u0435\u0434\u0440\u0438\u043c \u0434\u0432\u0430 \u043d\u043e\u0432\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430: \u0441\u0435\u0440\u0432\u0438\u0441 \u043e\u0431\u043c\u0435\u043d\u0430 <a href=\"http:\/\/www.addthis.com\/\">AddThis<\/a> \u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 <a href=\"http:\/\/www.feedburner.com\">Feedburner.<br \/>  <\/a>  <\/li>\n<li>\n<h3>\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438<\/h3>\n<p>  <\/p>\n<ul>\n<li>ASP.NET MVC 4.0<\/li>\n<li>Fluent NHibernate and NHibernate<\/li>\n<li>SQL Server 2012<\/li>\n<li>Ninject<\/li>\n<li>jQuery<\/li>\n<\/ul>\n<\/li>\n<li>\n<h3>C\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<br \/>  <\/h3>\n<p>  \u041e\u043f\u0438\u0448\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438:<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 1.\u0412\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043f\u043e\u0441\u0442 \u0432 \u0431\u043b\u043e\u0433\u0435<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 2.\u0412\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438,<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 3.\u0412\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0435\u0433\u0430<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 4.\u041f\u043e\u0438\u0441\u043a \u043f\u043e\u0441\u0442\u043e\u0432<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 5.\u0412\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0441\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 6.\u0412\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438, \u0432 \u0432\u0438\u0434\u0436\u0435\u0442\u0435<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 7.\u0412\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0435\u0433\u0430 \u0432 \u0432\u0438\u0434\u0436\u0435\u0442<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 8.\u0412\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043f\u043e\u0441\u0442 \u0432 \u0432\u0438\u0434\u0436\u0435\u0442\u0435<\/p>\n<h4>\u0417\u0430\u0434\u0430\u0447\u0430 1. \u0412\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043f\u043e\u0441\u0442 \u0432 \u0431\u043b\u043e\u0433\u0435<\/h4>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043f\u043e\u0441\u0442\u043e\u0432 \u0431\u043b\u043e\u0433\u0430 \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0438\u0445 \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/834\/8e7\/3f2\/8348e73f29abdd56d5c38b272311b077.png\"\/><\/p>\n<p>  \u042d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u043e\u0431\u044c\u0435\u043c \u0435\u0435 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043b\u043a\u0438\u0445 \u043f\u043e\u0434\u0437\u0430\u0434\u0430\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0433\u0447\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/p>\n<ol>\n<li>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 (solution)<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b<\/li>\n<li>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c Fluent NHibernate \u0438 NHibernate<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u044b \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0438 \u043c\u0435\u0442\u043e\u0434\u044b<\/li>\n<li>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c Ninject \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 JustBlog.Core<\/li>\n<li>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c Ninject \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 MVC<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/li>\n<\/ol>\n<h5>4.1 \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h5>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 MVC 4 web application \u0438 \u043d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 \u0435\u0433\u043e <strong>JustBlog<\/strong>. <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/360\/16a\/35e\/36016a35e491ff2285e6787ddd57364d.png\"\/><\/p>\n<p>  \u0412 \u043e\u043a\u043d\u0435 \u00abSelect a template\u00bb \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <strong>\u00abEmpty template\u00bb<\/strong>.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/a4e\/a71\/14f\/a4ea7114f427ef4c129cd4960850fe42.png\"\/><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 (class library) \u0438 \u043d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 \u0435\u0435 <strong>JustBlog.Core<\/strong>. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u0442\u0430\u043a \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0433\u0447\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0432 \u043f\u043b\u0430\u043d\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f. \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 <strong>JustBlog.Core<\/strong> \u0432 <strong>JustBlog<\/strong>.<\/p>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/9e7\/092\/ff6\/9e7092ff6f0a65a6d96f837bdd1b1476.png\"\/><\/p>\n<h5>4.2 \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432<\/h5>\n<p>  \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 <strong>JustBlog.Core<\/strong> \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <strong>Objects<\/strong>, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043d\u0435\u0439 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043e\u043c\u0435\u043d\u0430. \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043b\u043e\u0433\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430: <strong>Post<\/strong>, <strong>Category<\/strong> \u0438 <strong>Tag<\/strong>. \u041a\u0430\u0436\u0434\u044b\u0439 <strong>Post<\/strong> \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043e\u0434\u043d\u043e\u0439 <strong>Category<\/strong>, \u043d\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c <strong>Tags<\/strong>. \u041c\u0435\u0436\u0434\u0443 <strong>Post<\/strong> \u0438 <strong>Category<\/strong> \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f <em>\u043c\u043d\u043e\u0433\u0438\u0435-\u043a-\u043e\u0434\u043d\u043e\u043c\u0443<\/em> \u0438 \u043c\u0435\u0436\u0434\u0443 <strong>Post<\/strong> \u0438 <strong>Tag<\/strong> \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f <em>\u043c\u043d\u043e\u0433\u0438\u0435-\u043a\u043e-\u043c\u043d\u043e\u0433\u0438\u043c<\/em>.<\/p>\n<p>  \u041e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u043d\u0438\u0436\u0435<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/6a9\/3c9\/538\/6a93c9538bf5b6908f38976157d2d009.jpg\"\/><\/p>\n<p>  \u041d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 Post<\/p>\n<pre><code class=\"cs\">namespace JustBlog.Core.Objects {     public class Post     {         public virtual int Id         { get; set; }           public virtual string Title         { get; set; }           public virtual string ShortDescription         { get; set; }           public virtual string Description         { get; set; }           public virtual string Meta         { get; set; }           public virtual string UrlSlug         { get; set; }           public virtual bool Published         { get; set; }           public virtual DateTime PostedOn         { get; set; }           public virtual DateTime? Modified         { get; set; }           public virtual Category Category         { get; set; }           public virtual IList&lt;Tag&gt; Tags         { get; set; }     } } <\/code><\/pre>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0439. \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e <strong>UrlSlug<\/strong> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c \u0434\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <strong>Title<\/strong> \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u0441\u0442 \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c \u00abAdvanced Linq in C#\u00bb, \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 \u0430\u0432\u0433\u0443\u0441\u0442\u0435 2010 \u0433\u043e\u0434\u0430, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u043b\u044f \u043d\u0435\u0433\u043e URL-\u0430\u0434\u0440\u0435\u0441 <em>http\/\/localhost\/archive\/2010\/8\/Advanced Linq in C#<\/em>. \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043f\u043e\u0441\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 &quot;#&quot;) \u0438 \u043d\u0435 \u0432\u0441\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b. \u0412\u043c\u0435\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <strong>Title<\/strong> \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 URL, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043f\u043e\u0441\u0442\u0430 \u0438 \u0431\u0440\u0430\u0442\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0435\u0433\u043e \u0438\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <strong>URL Slug<\/strong>.<\/p>\n<p>  \u0412 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abAdvanced Linq in C#\u00bb \u0432 URL \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442(slug) <em>\u00abadvanced_linq_in_csharp\u00bb<\/em>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441 \u0431\u0443\u0434\u0435\u0442 http\/\/localhost\/archive\/2010\/8\/advanced_linq_in_csharp. \u0412 \u0447\u0430\u0441\u0442\u0438 3 \u043c\u044b \u0443\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c slug \u0438\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u043f\u043e\u0441\u0442\u0430.<\/p>\n<blockquote><p><strong>URL Slug<\/strong><br \/>  URL Slug \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f SEO \u2014 \u0438 user-\u0434\u0440\u0443\u0436\u0435c\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 URL \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0443. \u0427\u0430\u0441\u0442\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441\u0442\u0430\u0442\u044c\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u043e\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e.  <\/p><\/blockquote>\n<p>  C\u0432\u043e\u0439\u0441\u0442\u0432\u043e <strong>\u041c\u0435\u0442\u0430<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u043f\u043e\u0441\u0442\u0430 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f SEO. \u0412\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u044b \u043a\u0430\u043a \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u043a\u0430\u043a <strong>NHibernate<\/strong> \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0435\u043c\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u044b\u043b\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438.<\/p>\n<p>  \u041a\u043b\u0430\u0441\u0441\u044b <strong>Category<\/strong> \u0438 <strong>Tag<\/strong>, \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043d\u0438\u0436\u0435. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <strong>UrlSlug<\/strong> \u043f\u043e \u0442\u043e\u0439 \u0436\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u043b\u0438 \u0432\u044b\u0448\u0435.<\/p>\n<pre><code class=\"cs\">namespace JustBlog.Core.Objects {     public class Category     {         public virtual int Id         { get; set; }           public virtual string Name         { get; set; }           public virtual string UrlSlug         { get; set; }           public virtual string Description         { get; set; }           public virtual IList&lt;Post&gt; Posts         { get; set; }     } } <\/code><\/pre>\n<pre><code class=\"cs\">namespace JustBlog.Core.Objects {     public class Tag     {         public virtual int Id         { get; set; }           public virtual string Name         { get; set; }           public virtual string UrlSlug         { get; set; }           public virtual string Description         { get; set; }           public virtual IList&lt;Post&gt; Posts         { get; set; }     } } <\/code><\/pre>\n<h5>4.3 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Fluent NHibernate \u0438 NHibernate<\/h5>\n<p>  \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>NHibernate<\/strong> \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 <strong>Fluent NHibernate<\/strong>. NHibernate-\u044d\u0442\u043e ORM \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 Entity Framework, \u0433\u0434\u0435 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 XML-\u0444\u0430\u0439\u043b\u044b. Fluent NHibernate-\u044d\u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f NHibernate \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e XML-\u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0421\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043a\u043b\u0430\u0441\u0441\u044b \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u0447\u0435\u0440\u0435\u0437 XML-\u0444\u0430\u0439\u043b\u044b.<\/p>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043b\u0435\u0433\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 NHibernate \u0438 Fluent NHibernate \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>Nuget Package Manager Console<\/strong>. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 Package Manager \u0438\u0437 \u043c\u0435\u043d\u044e <strong>Tools -&gt; Library Package Manager -&gt; Package Manager Console<\/strong>.<\/p>\n<p>  \u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443.<\/p>\n<p>  <code>PM&gt; Install-Package FluentNHibernate<\/code><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0432 \u043f\u0430\u043f\u043a\u0435 References \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <strong>JustBlog.Core<\/strong> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<p>  FluentNHibernate<br \/>  NHibernate<br \/>  Iesi.Collections <\/p>\n<h5>4.4 \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/h5>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435, \u0447\u0442\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 (mapping classes). \u041a\u043b\u0430\u0441\u0441 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043a\u043b\u0430\u0441\u0441 \u0438 \u0435\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0438 \u0435\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 <strong>JustBlog.Core<\/strong> \u043d\u043e\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <strong>Mappings<\/strong>, \u0447\u0442\u043e\u0431\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439.<\/p>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043e\u0442 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <strong>ClassMap<\/strong> \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Fluent NHibernate. \u0412\u0441\u0435 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435. <br \/>  \u041a\u043b\u0430\u0441\u0441 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 <strong>Post<\/strong>.<\/p>\n<pre><code class=\"cs\">using FluentNHibernate.Mapping; using JustBlog.Core.Objects;   namespace JustBlog.Core.Mappings {     public class PostMap: ClassMap&lt;Post&gt;     {         public PostMap()         {             Id(x =&gt; x.Id);               Map(x =&gt; x.Title).Length(500).Not.Nullable();               Map(x =&gt; x.ShortDescription).Length(5000).Not.Nullable();               Map(x =&gt; x.Description).Length(5000).Not.Nullable();               Map(x =&gt; x.Meta).Length(1000).Not.Nullable();               Map(x =&gt; x.UrlSlug).Length(200).Not.Nullable();               Map(x =&gt; x.Published).Not.Nullable();               Map(x =&gt; x.PostedOn).Not.Nullable();               Map(x =&gt; x.Modified);               References(x =&gt; x.Category).Column(&quot;Category&quot;).Not.Nullable();               HasManyToMany(x =&gt; x.Tags).Table(&quot;PostTagMap&quot;);         }     } } <\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <strong>Id<\/strong> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043c\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 \u0434\u043b\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. <\/p>\n<p>  \u041c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <strong>Map<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0441\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0412 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0434\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u043e\u043b\u0431\u0446\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0438 \u043e\u043d \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f NULL \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. <\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cs\">Map(x =&gt; x.ShortDescription).Length(5000).Not.Nullable(); <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0442\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0438\u043c\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <strong>Column<\/strong>.<\/p>\n<pre><code class=\"cs\">Map(x =&gt; x.Title).Column(&quot;post_title&quot;) <\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 <strong>References<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0432\u044f\u0437\u0438 <em>\u043c\u043d\u043e\u0433\u0438\u0435-\u043a-\u043e\u0434\u043d\u043e\u043c\u0443<\/em> \u043c\u0435\u0436\u0434\u0443 <strong>Post<\/strong> \u0438 <strong>Category<\/strong> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 <strong>Category<\/strong> \u0442\u0430\u0431\u043b\u0438\u0446\u044b <strong>Post<\/strong>. \u041c\u0435\u0442\u043e\u0434 <strong>HasManyToMany<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0432\u044f\u0437\u0438 \u00ab\u043c\u043d\u043e\u0433\u0438\u0435-\u043a\u043e-\u043c\u043d\u043e\u0433\u0438\u043c\u00bb \u043c\u0435\u0436\u0434\u0443 <strong>Post<\/strong> \u0438 <strong>Tag<\/strong> \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 <strong>PostTagMap<\/strong>. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043e <strong>Fluent NHibernate<\/strong> \u0438 \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 <a href=\"https:\/\/github.com\/jagregory\/fluent-nhibernate\/wiki\/Fluent-mapping\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>.<\/p>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, <strong>Fluent NHibernate<\/strong> \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u0436\u0435, \u043a\u0430\u043a \u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430, \u0430 \u0438\u043c\u0435\u043d\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0436\u0435, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432. \u0415\u0441\u043b\u0438 \u0438\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f, \u0442\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <strong>Table<\/strong>.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cs\">Table(&quot;tbl_posts&quot;); <\/code><\/pre>\n<p>  \u041a\u043b\u0430\u0441\u0441\u044b \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u0434\u043b\u044f <strong>Category<\/strong> \u0438 <strong>Tag<\/strong> \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0436\u0435, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u0445 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0439 \u0441 <strong>Post<\/strong>. <strong>Category<\/strong> \u0438\u043c\u0435\u0435\u0442 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0441 <strong>Post<\/strong> <em>\u043e\u0434\u0438\u043d-\u043a\u043e-\u043c\u043d\u043e\u0433\u0438\u043c<\/em>, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a <strong>Tag<\/strong> \u0438\u043c\u0435\u0435\u0442 \u0441 <strong>Post<\/strong> \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 <em>\u043c\u043d\u043e\u0433\u0438\u0435-\u043a\u043e-\u043c\u043d\u043e\u0433\u0438\u043c<\/em>.<\/p>\n<pre><code class=\"cs\">namespace JustBlog.Core.Mappings {     public class CategoryMap: ClassMap&lt;Category&gt;     {         public CategoryMap()         {             Id(x =&gt; x.Id);               Map(x =&gt; x.Name).Length(50).Not.Nullable();               Map(x =&gt; x.UrlSlug).Length(50).Not.Nullable();               Map(x =&gt; x.Description).Length(200);               HasMany(x =&gt; x.Posts).Inverse().Cascade.All().KeyColumn(&quot;Category&quot;);         }     } } <\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <strong>Inverse()<\/strong>, \u0434\u0435\u043b\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0439(relationship) \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0437\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u041c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <strong>Cascade.All()<\/strong> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043a\u0430\u0441\u043a\u0430\u0434\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (\u0432\u043d\u0438\u0437 \u043f\u043e \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438) \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u0445 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 (\u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438, \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0438 \u043f\u043e\u0441\u0442\u044b).<\/p>\n<pre><code class=\"cs\">namespace JustBlog.Core.Mappings {     public class TagMap: ClassMap&lt;Tag&gt;     {         public TagMap()         {             Id(x =&gt; x.Id);               Map(x =&gt; x.Name).Length(50).Not.Nullable();               Map(x =&gt; x.UrlSlug).Length(50).Not.Nullable();               Map(x =&gt; x.Description).Length(200);               HasManyToMany(x =&gt; x.Posts).Cascade.All().Inverse().Table(&quot;PostTagMap&quot;);         }     } } <\/code><\/pre>\n<p>  \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d <strong>Repository<\/strong> \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043e\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432, \u0438 \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (unit testing) \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432. \u042f\u0434\u0440\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u2014 \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c.<\/p>\n<p>  \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 <strong>JustBlog.Core<\/strong> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <strong>IBlogRepository<\/strong> \u0441 \u0434\u0432\u0443\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438.<\/p>\n<pre><code class=\"cs\">using JustBlog.Core.Objects;  namespace JustBlog.Core {     public interface IBlogRepository     {         IList&lt;Post&gt; Posts(int pageNo, int pageSize);         int TotalPosts();     } } <\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 <strong>Posts<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0441\u0442\u043e\u0432 \u0440\u0430\u0437\u0431\u0438\u0442\u044b\u0445 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0435\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c. \u041c\u0435\u0442\u043e\u0434 <strong>TotalPosts<\/strong> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u0442 \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0441\u0442\u043e\u0432. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043d\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438.<\/p>\n<p>  \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 <strong>JustBlog.Core<\/strong> \u043a\u043b\u0430\u0441\u0441 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <strong>BlogRepository<\/strong> \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<pre><code class=\"cs\">using JustBlog.Core.Objects; using NHibernate; using NHibernate.Criterion; using NHibernate.Linq; using NHibernate.Transform; using System.Collections.Generic; using System.Linq;   namespace JustBlog.Core {     public class BlogRepository: IBlogRepository     {         \/\/ NHibernate object         private readonly ISession _session;           public BlogRepository(ISession session)         {             _session = session;         }           public IList&lt;Post&gt; Posts(int pageNo, int pageSize)         {         var posts = _session.Query&lt;Post&gt;()                               .Where(p =&gt; p.Published)                               .OrderByDescending(p =&gt; p.PostedOn)                               .Skip(pageNo * pageSize)                               .Take(pageSize)                               .Fetch(p =&gt; p.Category)                               .ToList(); \t\t}           var postIds = posts.Select(p =&gt; p.Id).ToList();           return _session.Query&lt;Post&gt;()               .Where(p =&gt; postIds.Contains(p.Id))               .OrderByDescending(p =&gt; p.PostedOn)               .FetchMany(p =&gt; p.Tags)               .ToList();         }           public int TotalPosts()         {             return _session.Query&lt;Post&gt;().Where(p =&gt; p.Published).Count();         }     } } <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044a\u0435\u043a\u0442 NHibernate <strong>ISession<\/strong>. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043f\u043e\u0441\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 <strong>ISession<\/strong>, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 <strong>Category<\/strong> \u0438 <strong>Tags<\/strong> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f. \u041c\u0435\u0442\u043e\u0434\u044b <strong>Fetch<\/strong> \u0438 <strong>FetchMany<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c NHibernate \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438\u0445 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e.<\/p>\n<p>  \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 <strong>Posts<\/strong>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u044b, \u043c\u044b \u0434\u0432\u0430\u0436\u0434\u044b \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>FetchMany<\/strong> \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 <strong>Skip<\/strong> \u0438 <strong>Take<\/strong> \u0432 Linq \u0437\u0430\u043f\u0440\u043e\u0441\u0435. \u0418\u0442\u0430\u043a, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u043f\u043e\u0441\u0442\u044b, \u0437\u0430\u0442\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u0445 ID \u043c\u044b \u0441\u043d\u043e\u0432\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u043e\u0441\u0442\u044b, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0445 \u0442\u0435\u0433\u0438. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"http:\/\/stackoverflow.com\/questions\/9729262\/nhibernate-linq-provider-and-take-skip-with-eager-fetching\">\u044d\u0442\u0443 \u0432\u0435\u0442\u043a\u0443<\/a> \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u043e\u0431 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435.<\/p>\n<blockquote><p><strong>NHibernate ISession<\/strong><\/p>\n<p>  ISession \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 (persistence manager), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <em>Persistent \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u043b\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0435\u0433\u043e \u043f\u043e\u0440\u043e\u0434\u0438\u0432\u0448\u0435\u0433\u043e. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 transient, \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0449\u0435\u0433\u043e, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u2014 \u043e\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0432\u043e\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0440\u043e\u0434\u0438\u0432\u0448\u0435\u0433\u043e \u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. (\u043f\u0440\u0438\u043c.\u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430).<\/em>  <\/p><\/blockquote>\n<h5>4.5 \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043a\u0430 Ninject \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 JustBlog.Core<\/h5>\n<p>  \u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 (DI) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430. \u042d\u0442\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u0432\u043e\u0434\u044f\u0442 \u0432 \u043a\u043b\u0430\u0441\u0441 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0447\u0435\u0440\u0435\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0432 \u0447\u0430\u0441\u0442\u0438 3.<\/p>\n<p>  \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u0430\u043a Castle Windsor, Unity, Autofac, StructureMap, Ninject \u0438 \u0442. \u0434. \u041c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 <strong>Ninject<\/strong>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u043f\u0440\u043e\u0441\u0442 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c <strong>Ninject<\/strong> \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 <strong>JustBlog.Core<\/strong>, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 <strong>Package Manager Console<\/strong>.<\/p>\n<p>  <code>PM&gt; Install-Package Ninject<br \/>  PM&gt; Install-Package Ninject.Web.Common<br \/>  <\/code><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0441\u0431\u043e\u0440\u043a\u0438 Ninject \u0438 NinjectWeb.Common \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442. \u0412\u043c\u0435\u0441\u0442\u0435 \u0441\u043e \u0441\u0431\u043e\u0440\u043a\u0430\u043c\u0438 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0441\u044f \u0444\u0430\u0439\u043b <strong>NinjectWebCommon.cs<\/strong> \u0432 \u043f\u0430\u043f\u043a\u0443 <strong>App_Start<\/strong>. \u0412 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u044f \u043e\u0431\u044a\u044f\u0441\u043d\u044e, \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 Ninject.Web.Common.<\/p>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c <strong>Ninject<\/strong> \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438, \u043b\u0438\u0431\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>Global.asax.cs<\/strong> \u043b\u0438\u0431\u043e \u0447\u0435\u0440\u0435\u0437 \u0444\u0430\u0439\u043b <strong>App_Start<\/strong>. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0443\u0434\u0430\u043b\u0438\u0442\u0435 \u0444\u0430\u0439\u043b <strong>NinjectWebCommon.cs<\/strong> \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 <strong>App_Start<\/strong>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 <strong>WebActivator<\/strong> \u0438 <strong>Microsoft.Web.Infrastructure<\/strong> \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043b\u044e\u0431\u043e\u0433\u043e DI-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u2014 \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438 \u044d\u0442\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. \u0421\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 (binding). \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0438\u0432\u044f\u0437\u043e\u043a \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c Ninject \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ninject Modules. \u0412\u0441\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Ninject \u044f\u0434\u0440\u0430 Kernel. \u0412\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, Kernel, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e.<\/p>\n<blockquote><p><strong>Ninject Module<\/strong><\/p>\n<p>  \u041c\u043e\u0434\u0443\u043b\u044c Ninject \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u0439\/\u043f\u0440\u0438\u0432\u044f\u0437\u043e\u043a, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435.  <\/p><\/blockquote>\n<p>  \u041a\u043b\u0430\u0441\u0441 <strong>BlogRepository<\/strong> \u0438\u043c\u0435\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0441 <strong>Nibernate ISession<\/strong>. \u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 <strong>ISession<\/strong> \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0434\u0440\u0443\u0433\u043e\u0439 Nibernate \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <strong>ISessionFactory<\/strong>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 <strong>JustBlog.Core<\/strong> ninject-\u043c\u043e\u0434\u0443\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0430 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <strong>RepositoryModule<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0432\u044f\u0436\u0435\u0442 \u043e\u0431\u0430 \u044d\u0442\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044bq Ninject-\u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <strong>NinjectModule<\/strong> \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <strong>Load<\/strong>. \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 Load, \u043c\u044b \u0441\u0432\u044f\u0436\u0435\u043c \u043e\u0431\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <strong>Bind<\/strong>.<\/p>\n<p>  \u041c\u0435\u0442\u043e\u0434 <strong>Bind<\/strong> \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cs\">Bind&lt;IFoo&gt;().To&lt;Foo&gt;(); <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. <\/p>\n<pre><code class=\"cs\">Bind&lt;IFoo&gt;().ToMethod(c =&gt; {     var foo = new Foo();     return foo; }); <\/code><\/pre>\n<blockquote><p><strong>NHibernate ISessionFactory<\/strong><\/p>\n<p>  \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 ISession \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043e\u0434\u0438\u043d \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 ISessionFactory \u0432\u043e \u0432\u0441\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.  <\/p><\/blockquote>\n<pre><code class=\"cs\">using FluentNHibernate.Cfg; using FluentNHibernate.Cfg.Db; using JustBlog.Core.Objects; using NHibernate; using NHibernate.Cache; using Ninject; using Ninject.Modules; using Ninject.Web.Common;   namespace JustBlog.Core {     public class RepositoryModule: NinjectModule     {         public override void Load()         {             Bind&lt;ISessionFactory&gt;()                 .ToMethod                 (                     e =&gt;                         Fluently.Configure()                         .Database(MsSqlConfiguration.MsSql2008.ConnectionString(c =&gt;                             c.FromConnectionStringWithKey(&quot;JustBlogDbConnString&quot;)))                         .Cache(c =&gt; c.UseQueryCache().ProviderClass&lt;HashtableCacheProvider&gt;())                         .Mappings(m =&gt; m.FluentMappings.AddFromAssemblyOf&lt;Post&gt;())                         .ExposeConfiguration(cfg =&gt; new SchemaExport(cfg).Execute(true, true, false))                         .BuildConfiguration()                         .BuildSessionFactory()                 )                 .InSingletonScope();               Bind&lt;ISession&gt;()                 .ToMethod((ctx) =&gt; ctx.Kernel.Get&lt;ISessionFactory&gt;().OpenSession())                 .InRequestScope();         }     } } <\/code><\/pre>\n<p>  \u0421\u0446\u0435\u043f\u043b\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u044b\u043c\u0438! \u041d\u0438\u0436\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0440\u0435\u0448\u0430\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/p>\n<p>  \u0430. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 (Database)<br \/>  \u0431. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0434\u043b\u044f \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (Cache)<br \/>  \u0432. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043e\u043c\u0435\u043d\u0430 \u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f (Mappings)<br \/>  \u0434. \u041f\u0440\u043e\u0441\u0438\u043c NHibernate \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 (ExposeConfiguration)<\/p>\n<pre><code class=\"cs\">Fluently.Configure()     .Database(MsSqlConfiguration.MsSql2008.ConnectionString(c =&gt;         c.FromConnectionStringWithKey(&quot;JustBlogDbConnString&quot;)))     .Cache(c =&gt; c.UseQueryCache().ProviderClass&lt;HashtableCacheProvider&gt;())     .Mappings(m =&gt; m.FluentMappings.AddFromAssemblyOf&lt;Post&gt;())     .ExposeConfiguration(cfg =&gt; new SchemaExport(cfg).Execute(true, true, false))     .BuildConfiguration()     .BuildSessionFactory() <\/code><\/pre>\n<p>  \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432 Ninject \u0438 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0438\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Ninject.Web.Common, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 WebForms \u0438 MVC \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 Ninject \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 ISession. \u041c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <strong>InRequestScope()<\/strong>, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d Ninject.Web.Common, \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 Ninject \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u043e\u0433\u043e ASP.NET, \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430. \u041c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <strong>InSingletonScope()<\/strong> \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 (singleton), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432\u043e \u0432\u0441\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<h5>4.6 \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043a\u0430 Ninject \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 MVC<\/h5>\n<p>   \u0412\u0441\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <strong>IBlogRepository<\/strong> \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u0427\u0442\u043e\u0431\u044b \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 <strong>IBlogRepository<\/strong> \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c Ninject \u0432 MVC-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0415\u0441\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 (Ninject.Mvc3) \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 MVC. <\/p>\n<p>   \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c Ninject.Mvc3 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 <strong>JustBlog<\/strong>, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443.<\/p>\n<p>  <code>PM&gt; Install-Package Ninject.Mvc3<br \/>  <\/code><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 MVC project \u0434\u043e\u0431\u0430\u0432\u044f\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438:<\/p>\n<p>  Ninject<br \/>  Ninject.Web.Common<br \/>  Ninject.Web.Mvc<\/p>\n<p>  <u>\u0423\u0434\u0430\u043b\u0438\u0442\u0435 \u0444\u0430\u0439\u043b NinjectWebCommon.cs<\/u> \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 App_Start. \u041d\u0430\u0441\u043b\u0435\u0434\u0443\u0439\u0442\u0435 \u043d\u0430\u0448 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <strong>NinjectHttpApplication<\/strong> \u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 <strong>CreateKernel<\/strong>. <br \/>  \u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b Global.asax.cs \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.<\/p>\n<pre><code class=\"cs\">using Ninject; using Ninject.Web.Common; using System.Web.Mvc; using System.Web.Routing;   namespace JustBlog {     public class MvcApplication : NinjectHttpApplication     {         protected override IKernel CreateKernel()         {             var kernel = new StandardKernel();             kernel.Load(new RepositoryModule()); \t\t\tkernel.Bind&lt;IBlogRepository&gt;().To&lt;BlogRepository&gt;();             return kernel;         }           protected override void OnApplicationStarted()         {             RouteConfig.RegisterRoutes(RouteTable.Routes);             base.OnApplicationStarted();         }     } } <\/code><\/pre>\n<p>  \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 <strong>CreateKernel<\/strong>, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 <strong>StandardKernel<\/strong> \u0442\u0438\u043f\u0430 <strong>IKernel<\/strong>. IKernel-\u044d\u0442\u043e \u044f\u0434\u0440\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0433\u0434\u0435 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448\u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0438 \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u043e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0435\u0433\u043e.<\/p>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 <strong>StandardKernel<\/strong> \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0430\u0440\u0443 \u0432\u0430\u0436\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u044b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f <strong>Repository<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438 <strong>NHibernate<\/strong> \u0438 \u0437\u0430\u0442\u0435\u043c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <strong>IBlogRepository<\/strong> \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <strong>BlogRepository<\/strong>. \u041d\u0443 \u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432 \u043a\u043e\u043d\u0446\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043a\u043e\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0435\u0445\u0430\u043b \u0432 \u043c\u0435\u0442\u043e\u0434 OnApplicationStarted.<\/p>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435 \u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Ninject \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u043d\u0430\u0447\u043d\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c\u0438 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\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=\"https:\/\/habrahabr.ru\/post\/278633\/\"> https:\/\/habrahabr.ru\/post\/278633\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<ol>\n<li>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439: \u0447\u0442\u0435\u043d\u0438\u0435 \u043a\u043d\u0438\u0433, \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u044f\u0445, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435. \u042f \u0441\u0447\u0438\u0442\u0430\u044e \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043b\u0443\u0447\u0448\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u0437\u0443\u0447\u0430\u0435\u043c\u043e\u0439 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438. \u0411\u043b\u043e\u0433 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0435\u0433\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u0412 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439, \u043c\u044b \u0438\u0437\u0443\u0447\u0438\u043c ASP.NET MVC, \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c, \u043f\u0443\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043b\u043e\u0433\u0430 \u0441 \u043d\u0443\u043b\u044f.  <\/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-275575","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/275575","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=275575"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/275575\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=275575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=275575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=275575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}