{"id":221681,"date":"2014-05-03T22:10:03","date_gmt":"2014-05-03T18:10:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=221681"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=221681","title":{"rendered":"<span class=\"post_title\">\u041f\u0440\u043e\u0444\u0430\u0439\u043b\u0435\u0440 \u0434\u043b\u044f Entity Framework<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/f3c\/3be\/a1f\/f3c3bea1fcedb7d975612d893eb44a26.png\"\/><\/p>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e!<\/p>\n<p>  \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0443 <a href=\"http:\/\/habrahabr.ru\/users\/Diaver\/topics\/\">\u0441\u0435\u0440\u0438\u044e \u0441\u0442\u0430\u0442\u0435\u0439<\/a> \u043f\u0440\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u041d\u0430 \u044d\u0442\u043e \u0440\u0430\u0437 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u0441 Entity Framework-\u0443 ( \u0434\u0430\u043b\u0435\u0435 EF) c 4-\u0439 \u043f\u043e 6-\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0445 \u043c\u043d\u043e\u0439 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 .NET \u043a\u043e\u0434\u0430 \u043d\u0430 \u043b\u0435\u0442\u0443, \u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e \u0438 \u043f\u0440\u043e\u0447\u0435\u0435.<\/p>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h5>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h5>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u044f \u043d\u0430\u0447\u0438\u043d\u0430\u043b \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 EF, \u043f\u0435\u0440\u0435\u0434\u043e \u043c\u043d\u043e\u0439 \u0441\u0442\u0430\u043b \u0432\u043e\u043f\u0440\u043e\u0441 \u0432 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 EF. \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u044f \u0441 \u043d\u0435\u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e \u0448\u0442\u0430\u0442\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 EF \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 SQL Server Profiler \u0438\u043b\u0438 \u043a\u0443\u043f\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 <a href=\"http:\/\/www.hibernatingrhinos.com\/products\/efprof\">Entity Framework Profiler 2.0<\/a>, \u0437\u0430 $389.00, <s>\u0430 \u044f \u0436\u0430\u0434\u043d\u044b\u0439<\/s>.<\/p>\n<p>  \u0421 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c EF \u0432\u0435\u0440\u0441\u0438\u0438 6, \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0441 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0430\u0441\u044c. \u041f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0446\u0435\u043f\u0442\u043e\u0440:  <\/p>\n<pre><code class=\"cs\">\/\/\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c  \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441\u0432\u043e\u0439 IDbCommandInterceptor  DbInterception.Add(new LogFormatter()); <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"cs\">public class LogFormatter : IDbCommandInterceptor { \tprivate readonly Stopwatch _stopwatch = new Stopwatch(); \tpublic void NonQueryExecuting(DbCommand command, DbCommandInterceptionContext&lt;int&gt; interceptionContext) \t{ \t\t\/\/ \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043c \u0442\u0430\u0439\u043c\u0435\u0440 \t\t_stopwatch.Restart(); \t} \tpublic void NonQueryExecuted(DbCommand command, DbCommandInterceptionContext&lt;int&gt; interceptionContext) \t{ \t\t\/\/ \u041e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0442\u0430\u0439\u043c\u0435\u0440 \t\t_stopwatch.Stop(); \t\t\/\/ \u041b\u043e\u0433\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \t\tLog(command, interceptionContext); \t} \tpublic void ReaderExecuting(DbCommand command, DbCommandInterceptionContext&lt;DbDataReader&gt; interceptionContext) \t{ \t\t_stopwatch.Restart(); \t} \tpublic void ReaderExecuted(DbCommand command, DbCommandInterceptionContext&lt;DbDataReader&gt; interceptionContext) \t{ \t\t_stopwatch.Stop(); \t\tLog(command, interceptionContext); \t} \tpublic void ScalarExecuting(DbCommand command, DbCommandInterceptionContext&lt;object&gt; interceptionContext) \t{ \t\t_stopwatch.Restart(); \t} \tpublic void ScalarExecuted(DbCommand command, DbCommandInterceptionContext&lt;object&gt; interceptionContext) \t{ \t\t_stopwatch.Stop(); \t\tLog(command, interceptionContext); \t} \tprivate void Log&lt;TResult&gt;(DbCommand command, DbCommandInterceptionContext&lt;TResult&gt; interceptionContext) \t{ \t\tLogger.Log(command, _stopwatch.ElapsedMilliseconds, interceptionContext.Exception); \t} } <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"cs\">public static class Logger { \tpublic static void Log(DbCommand command, long elapsedMilliseconds, Exception exception) \t{ \t\t\/\/ \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0432 Trace \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \t\tTrace.WriteLine(string.Format(&quot;Command:{0}, Elapsed Milliseconds:{1}&quot;, command.CommandText, elapsedMilliseconds)); \t} } <\/code><\/pre>\n<p>  \u0414\u043b\u044f 4-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 EF \u043f\u043e\u0445\u043e\u0436\u0435\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b.<\/p>\n<h5>\u041c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/h5>\n<p>  \u0418\u0434\u0435\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0435\u0440, \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043f\u043b\u0430\u0442\u043d\u043e\u0433\u043e, \u044f \u0432\u044b\u043d\u0430\u0448\u0438\u0432\u0430\u043b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0433\u043e. \u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0430\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0435 \u0438\u043d\u0442\u0435\u0440\u0446\u0435\u043f\u0442\u043e\u0440\u043e\u0432 EF 6-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u043d\u043e \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0432 EF 4-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0434\u043e\u043b\u0433\u043e\u0433\u043e \u0433\u0443\u0433\u043b\u0435\u043d\u0438\u044f, \u0431\u044b\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u043a\u0438 EF \u0432 ASP MVC \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445, \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"http:\/\/miniprofiler.com\/\">MiniProfiler <\/a>. \u041d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u0438 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h5>\u0427\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c<\/h5>\n<p>  \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438. \u0417\u0430\u0431\u0440\u0430\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0438 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c \u043c\u043d\u043e\u0439 \u0441\u0430\u0439\u0442\u0435 \u043d\u0430 wordpress-e <a href=\"http:\/\/ef-logger.com\/\">http:\/\/ef-logger.com\/<\/a><br \/>  \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/481\/3e0\/156\/4813e0156b74bf05ad9ed78376588e5a.png\"\/><\/p>\n<h5>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/h5>\n<p>  1. \u0417\u0430\u0431\u0440\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0432 \u0441 <a href=\"http:\/\/ef-logger.com\/download\/\">\u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430\u043c\u0438 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a> <br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/9a3\/0ee\/058\/9a30ee058b5b9b92a0e1f58d2f971cc0.png\"\/><br \/>  2. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 EFlogger.EntityFramework4.dll \u0434\u043b\u044f EF 4-5 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438 EFlogger.EntityFramework6.dll \u0434\u043b\u044f EF 6-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438<br \/>  3. \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0435\u0440 \u043f\u0443\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430   <\/p>\n<pre><code class=\"cs\">\/\/ \u0414\u043b\u044f EF 6-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 EFloggerFor6.Initialize(); \/\/ \u0438\u043b\u0438 \u0434\u043b\u044f  EF \u0441 4-\u0439 \u043f\u043e 6-\u044e EFloggerFor4.Initialize(); <\/code><\/pre>\n<p>  4. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 EFlogger.exe<\/p>\n<h5>API<\/h5>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 EFlogger.EntityFramework6.dl, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f EFlogger.EntityFramework4.dl \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u0442\u044c\u0441\u044f EFloggerFor6  <\/p>\n<pre><code class=\"cs\">\/\/\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f EFloggerFor6.Initialize();  \/\/ \u0417\u0430\u0434\u0430\u0435\u0442 IP \u043f\u0440\u043e\u0444\u0430\u043b\u0435\u0440\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0435\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 &quot;127.0.0.1&quot; EFloggerFor6.SetProfilerClientIP(\u201c192.168.10.50\u2033);  \/\/ \u041f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0435\u0440 EFloggerFor6.WriteMessage(\u201cText message\u201d);  \/\/ \u0421\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u043f\u043e\u0441\u044b\u043b\u043a\u0443 \u043b\u043e\u0433\u043e\u0432 \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0435\u0440 (\u0443\u0436\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438)  EFloggerFor6.StartSendToClient();  \/\/ \u041e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0441\u044b\u043b\u043a\u0443 \u043b\u043e\u0433\u043e\u0432 \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0435\u0440 EFloggerFor6.StopSendToClient();  \/\/ \u0421\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0444\u0430\u0439\u043b EFlogger.log \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f EFloggerFor6.StartSaveToLogFile();  \/\/ \u041e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0444\u0430\u0439\u043b EFlogger.log \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f EFloggerFor6.StopSaveToLogFile();  \/\/\u041e\u0447\u0438\u0449\u0430\u0435\u0442 \u043b\u043e\u0433 \u0432 \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0435\u0440\u0435 \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0444\u0430\u0439\u043b \u043b\u043e\u0433\u0430, \u0435\u0441\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d EFloggerFor6.ClearLog();  \/\/ \u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u043a\u043e\u0434\u0430 EFloggerFor6.DisableDecompiling();  \/\/ \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0431\u043e\u0440\u043a\u0443 \u0434\u043b\u044f \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 Stack Trace-a EFloggerFor6.ExcludeAssembly(\u201cMyAssemly\u201d); <\/code><\/pre>\n<h5>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h5>\n<p>  \u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0432 EF 4-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 EF 6-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.<br \/>  \u0428\u0442\u0430\u0442\u043d\u044b\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u043f\u043e\u0434\u043c\u0435\u043d\u044b DbProviderFactory \u0432 EF 4 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0434\u0442\u0438 \u043d\u0430 \u043f\u043e\u0434\u043c\u0435\u043d\u0443 \u0448\u0442\u0430\u0442\u043d\u043e\u0439 \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u043d\u0430 \u0441\u0432\u043e\u044e \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0444\u043b\u0435\u043a\u0446\u0438\u044e.<br \/>  \u0421\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"cs\">\/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0447\u0442\u043e \u0432\u0441\u0435 \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b DbProviderFactories.GetFactoryClasses();  \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0438\u043f DbProviderFactories Type type = typeof(DbProviderFactories);  DataTable table = null; \/\/\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 DataSet \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u044f _configTable \u0438\u043b\u0438 _providerTable object setOrTable = (type.GetField(&quot;_configTable&quot;, BindingFlags.NonPublic | BindingFlags.Static) ??                 type.GetField(&quot;_providerTable&quot;, BindingFlags.NonPublic | BindingFlags.Static)).GetValue(null);  var set = setOrTable as DataSet; if (set != null)     table = set.Tables[&quot;DbProviderFactories&quot;];  table = (DataTable)setOrTable;  \/\/ \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 DataTable \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0432\u043e\u044e \u0444\u0430\u0431\u0440\u0438\u043a\u0443 foreach (DataRow row in table.Rows.Cast&lt;DataRow&gt;().ToList()) {     DbProviderFactory factory;     try     {         factory = DbProviderFactories.GetFactory(row);     }     catch (Exception)     {         continue;     }      var profType = EFProviderUtilities.ResolveFactoryType(factory.GetType());     if (profType != null)     {         DataRow profiled = table.NewRow();         profiled[&quot;Name&quot;] = row[&quot;Name&quot;];         profiled[&quot;Description&quot;] = row[&quot;Description&quot;];         profiled[&quot;InvariantName&quot;] = row[&quot;InvariantName&quot;];         profiled[&quot;AssemblyQualifiedName&quot;] = profType.AssemblyQualifiedName;         table.Rows.Remove(row);         table.Rows.Add(profiled);     } } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 EF 6-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0448\u0442\u0430\u0442\u043d\u044b\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u043c \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432:  <\/p>\n<pre><code class=\"cs\">DbConfiguration.Loaded += (_, a) =&gt; a.ReplaceService&lt;DbProviderServices&gt;((s, k) =&gt; new EFProfiledDbProviderServices()); <\/code><\/pre>\n<h5>\u0414\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f<\/h5>\n<p>  EFlogger \u043d\u0430 \u043b\u0435\u0442\u0443 \u0434\u0435\u043a\u043e\u043c\u043f\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0442\u0435\u043b\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0442\u043e\u0442 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u0437 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0430 \u0440\u0435\u0444\u043b\u0435\u043a\u0442\u043e\u0440\u0430 <a href=\"http:\/\/habrahabr.ru\/post\/113500\/\">ILSpy<\/a>. \u0427\u0442\u043e\u0431\u044b \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u043d\u0443\u0436\u043d\u043e \u0435\u0433\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0442\u0438 \u043f\u043e\u0434\u043d\u044f\u0432\u0448\u0438\u0441\u044c \u043f\u043e Stack Trace \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a:  <\/p>\n<pre><code class=\"cs\">public static string Get(out StackFrame outStackFrame) { \toutStackFrame = null; \tvar frames = new StackTrace(0, true).GetFrames(); \tif (frames == null) \t{ \t\treturn &quot;&quot;; \t}  \tvar methods = new List&lt;string&gt;();  \t\/\/ \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u0444\u0440\u0435\u0439\u043c\u0430\u043c \tforeach (StackFrame t in frames) \t{ \t\t\/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \t\tvar method = t.GetMethod();  \t\t\/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u0435\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \t\tvar assembly = method.Module.Assembly.GetName().Name; \t\tif (ShouldExcludeType(method) || AssembliesToExclude.Contains(assembly) || \t\t\tMethodsToExclude.Contains(method.Name)) \t\t\tcontinue;  \t\t\/\/ \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e \u0441\u0442\u0435\u043a\u0443 \u0444\u0440\u0435\u0439\u043c \u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0430 \u043f\u0440\u043e\u043f\u0443\u0441\u043a \t\tif (outStackFrame == null) \t\t{ \t\t\toutStackFrame = t; \t\t} \t\tmethods.Add(method.DeclaringType.FullName + &quot;:&quot; + method.Name); \t} \treturn string.Join(&quot;\\r\\n&quot;, methods); } <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"cs\">private static string GetMethodBody(StackFrame stackFrame) { \tMethodBase methodBase = stackFrame.GetMethod(); \treturn Decompiler.GetSourceCode(methodBase.Module.FullyQualifiedName, methodBase.DeclaringType.Name, methodBase.Name); } <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Decompiler<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using System; using System.IO; using System.Linq; using ICSharpCode.Decompiler; using ICSharpCode.Decompiler.Ast; using ICSharpCode.Decompiler.Ast.Transforms; using Mono.Cecil;  namespace Common {     public static class Decompiler     {         public static string GetSourceCode(string pathToAssembly, string className, string methodName)         {             try             {                 var assemblyDefinition = AssemblyDefinition.ReadAssembly(pathToAssembly);                  TypeDefinition assembleDefenition = assemblyDefinition.MainModule.Types.First(type =&gt; type.Name == className);                 MethodDefinition methodDefinition = assembleDefenition.Methods.First(method =&gt; method.Name == methodName);                 var output = new StringWriter();                 var plainTextOutput = new PlainTextOutput(output);                 DecompileMethod(methodDefinition, plainTextOutput);                 return output.ToString();             }             catch (Exception exception)             {                  return string.Format( &quot;Exception in decompling. \\r\\n Message:{0}, \\r\\n Inner Exception:{1}, \\r\\n StackTrace:{2}&quot;,exception.Message, exception.InnerException, exception.StackTrace);             }         }          private static void DecompileMethod(MethodDefinition method, ITextOutput output)         {             AstBuilder codeDomBuilder = CreateAstBuilder(currentType: method.DeclaringType, isSingleMember: true);             if (method.IsConstructor && !method.IsStatic && !method.DeclaringType.IsValueType)             {                 AddFieldsAndCtors(codeDomBuilder, method.DeclaringType, method.IsStatic);                 RunTransformsAndGenerateCode(codeDomBuilder, output);             }             else             {                 codeDomBuilder.AddMethod(method);                 RunTransformsAndGenerateCode(codeDomBuilder, output);             }         }          private static AstBuilder CreateAstBuilder(ModuleDefinition currentModule = null, TypeDefinition currentType = null, bool isSingleMember = false)         {             if (currentModule == null)                 currentModule = currentType.Module;             var settings = new DecompilerSettings();             if (isSingleMember)             {                 settings = settings.Clone();                 settings.UsingDeclarations = false;             }             return new AstBuilder(                 new DecompilerContext(currentModule)                 {                     CurrentType = currentType,                     Settings = settings                 });         }          private static void AddFieldsAndCtors(AstBuilder codeDomBuilder, TypeDefinition declaringType, bool isStatic)         {             foreach (var field in declaringType.Fields)             {                 if (field.IsStatic == isStatic)                     codeDomBuilder.AddField(field);             }             foreach (var ctor in declaringType.Methods)             {                 if (ctor.IsConstructor && ctor.IsStatic == isStatic)                     codeDomBuilder.AddMethod(ctor);             }         }          private static void RunTransformsAndGenerateCode(AstBuilder astBuilder, ITextOutput output, IAstTransform additionalTransform = null)         {             astBuilder.GenerateCode(output);         }     } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043d\u0430 \u044f\u043d\u0434\u0435\u043a\u0441 \u0444\u0430\u0439\u043b\u0430\u0445: <a href=\"http:\/\/yadi.sk\/d\/AzBGet5-Nwns2\">yadi.sk\/d\/AzBGet5-Nwns2<\/a><\/p>\n<h5>\u041e\u043a\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438<\/h5>\n<p>  \u041d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u0441\u0435\u043a\u0440\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0430\u0434\u0430\u044e\u0442, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u043f\u043e \u0441\u0430\u043c\u044b\u043c \u0440\u0430\u0437\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0435 \u043e\u043a\u043d\u043e \u0434\u043b\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435.<br \/>  \u041c\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0444\u043e\u0440\u043c\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/3d3\/eee\/38a\/3d3eee38a2e65486bd9d2d383ca4442f.png\"\/><\/p>\n<p>  \u0424\u043e\u0440\u043c\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435, \u0448\u0430\u0433\u0438 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0438 \u0441\u0432\u043e\u0439 email \u0434\u043b\u044f \u043e\u0442\u0432\u0435\u0442\u0430.<br \/>  \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u043d\u0430 \u043f\u043e\u0447\u0442\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u0438\u0441\u044c\u043c\u043e \u0441\u043e \u0432\u0441\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u043c\u0438.  <\/p>\n<pre><code class=\"cs\"> [STAThread] [STAThread] static void Main() {      \tSetupLogger();         \/\/ \u0435\u0441\u043b\u0438 \u0434\u0435\u0431\u0430\u0433\u0435\u0440 \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d        \tif (!Debugger.IsAttached) \t{                 \/\/ \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \t\tApplication.ThreadException += (sender, e) =&gt; HandleError(e.Exception); \t\tAppDomain.CurrentDomain.UnhandledException += (sender, e) =&gt; HandleError((Exception)e.ExceptionObject); \t}  \tApplication.EnableVisualStyles(); \tApplication.SetCompatibleTextRenderingDefault(false); \tApplication.Run(new MainForm()); } private static void HandleError(Exception exception) { \ttry \t{                    \/\/ \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0444\u043e\u0440\u043c\u044b \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044b\u0439 try\/catch \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0441\u043b\u0438 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0442\u043e\u0436\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430 \t \tnew ErrorHandlerController(exception).Run(); \t} \tcatch (Exception e) \t{ \t\tMessageBox.Show(&quot;Error processing exception. Please send log file EFlogger.log to developer: &quot; + Settings.Default.ProgrammerEmail + &quot; \\r\\n Exception:&quot; + e);                 \/\/ \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043b\u043e\u0433 \u0444\u0430\u0439\u043b \t\tLogger.Error(e); \t\tif (MessageBox.Show(&quot;Attach debugger? \\n Only for developer!!!&quot;, &quot;Debugging...&quot;, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) \t\t{ \t\t\tDebugger.Launch(); \t\t\tthrow; \t\t} \t} \tfinally \t{                        \/\/ \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0442\u043e\u0431\u044b Windows \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u043b\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \t\tEnvironment.Exit(1); \t} }  \/\/new ErrorHandlerController(exception).Run(); public void Run() {      \/\/ \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0438  \t \tstring exceptionInfoText = string.Format( \t\t&quot;An unexpected error occurred: {0}&quot; + Environment.NewLine + \t\t&quot;Time: {1} &quot; + Environment.NewLine + \t\t&quot;{2}&quot; + Environment.NewLine + \t\t&quot;InnerException: \\n {3}&quot; + Environment.NewLine + \t\t&quot;InnerException StackTrace: \\n  {4}&quot; + Environment.NewLine,  \t\t_exception.Message,  \t\tDateTime.Now,  \t\t_exception,  \t\t_exception.InnerException,  \t\t_exception.InnerException != null  \t\t\t? _exception.InnerException.StackTrace  \t\t\t: string.Empty \t);          \/\/ \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0441 \u043b\u043e\u0433 \u0444\u0430\u0439\u043b \t \tProgram.Logger.Error(exceptionInfoText); \t_view.ExceptionInfoText = exceptionInfoText;  \t\/\/ \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u043e\u0440\u043c\u0443, \u0432\u044b\u0437\u0432\u0430\u0432 \u043c\u0435\u0442\u043e\u0434 ShowDialog, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \t_view.ShowDialog(); } <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u0444\u043e\u0440\u043c\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u043d\u0430 \u044f\u043d\u0434\u0435\u043a\u0441 \u0444\u0430\u0439\u043b\u0430\u0445: <a href=\"http:\/\/yadi.sk\/d\/7y4i_cz7NwtE3\">yadi.sk\/d\/7y4i_cz7NwtE3<\/a><\/p>\n<h5>\u041f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0435<\/h5>\n<p>  \u041d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0441\u043b\u0438 \u0441\u0430\u0439\u0442 \u0443\u043f\u0430\u0434\u0435\u0442, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0432 \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0435\u0440\u0430 \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u043d\u0430 \u044f\u043d\u0434\u0435\u043a\u0441 \u0444\u0430\u0439\u043b\u0430\u0445: <a href=\"http:\/\/yadi.sk\/d\/trLmkJnkNwtg7\">yadi.sk\/d\/trLmkJnkNwtg7<\/a><br \/>  \u0423\u0432\u0435\u0440\u0435\u043d, \u0431\u0430\u0433\u043e\u0432 \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0432\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e. \u0422\u0430\u043a \u0436\u0435, \u044f \u0445\u043e\u0447\u0443 \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0441\u043e\u0432\u0435\u0442\u0430 \u0443 \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u043e\u0433\u043e \u0445\u0430\u0431\u0440\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0435\u0440\u043e\u043c, \u0442\u0430\u043a \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442, \u043d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u044f \u0434\u0443\u043c\u0430\u044e \u043e \u0442\u043e\u043c \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0435\u0440 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u043c \u0434\u043b\u044f \u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u043b\u0430\u0442\u043d\u044b\u043c \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439, \u043d\u043e \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u043f\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0446\u0435\u043d\u0435 \u0431\u0430\u043a\u0441\u043e\u0432 \u0432 20-30. \u041d\u0443 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u043c \u0441 \u043a\u043d\u043e\u043f\u043e\u0447\u043d\u043e\u0439 Donate.<\/p>\n<p>  \u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d.<\/p>\n<p>  PS: \u041f\u043e \u0432\u0441\u0435\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c, \u0431\u0430\u0433 \u0440\u0435\u043f\u043e\u0440\u0442\u0430\u043c \u0438 \u043f\u0440\u043e\u0447\u0435\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u043f\u043e\u0447\u0442\u0443: developer@ef-logger.com \u0438\u043b\u0438 st.glushak@gmail.com. <s>\u0422\u0430\u043a\u0436\u0435, \u0430\u0432\u0442\u043e\u0440 \u0438\u0449\u0435\u0442 \u043f\u043e\u0434\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u0438\u0431\u043e \u0438\u043f\u043e\u0442\u0435\u043a\u0430. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/s>    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/221681\/\"> http:\/\/habrahabr.ru\/post\/221681\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/f3c\/3be\/a1f\/f3c3bea1fcedb7d975612d893eb44a26.png\"\/><\/p>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e!<\/p>\n<p>  \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0443 <a href=\"http:\/\/habrahabr.ru\/users\/Diaver\/topics\/\">\u0441\u0435\u0440\u0438\u044e \u0441\u0442\u0430\u0442\u0435\u0439<\/a> \u043f\u0440\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u041d\u0430 \u044d\u0442\u043e \u0440\u0430\u0437 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u0441 Entity Framework-\u0443 ( \u0434\u0430\u043b\u0435\u0435 EF) c 4-\u0439 \u043f\u043e 6-\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0445 \u043c\u043d\u043e\u0439 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 .NET \u043a\u043e\u0434\u0430 \u043d\u0430 \u043b\u0435\u0442\u0443, \u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e \u0438 \u043f\u0440\u043e\u0447\u0435\u0435.<\/p>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.  <\/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-221681","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/221681","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=221681"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/221681\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=221681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=221681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=221681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}