{"id":189806,"date":"2013-08-12T11:56:07","date_gmt":"2013-08-12T07:56:07","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=189806"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=189806","title":{"rendered":"<span class=\"post_title\">Entity Framework Code First \u2014 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u0435\u0439 \u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0438\u0441\u043a<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/812\/622\/991\/812622991738384883b48c1847acfe67.jpg\" alt=\"image\"\/><\/p>\n<p>  \u041f\u043e \u0440\u043e\u0434\u0443 \u043c\u043e\u0435\u0439 \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043c\u043d\u0435 \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u044d\u0442\u043e \u0441\u0430\u0439\u0442\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 ASP.NET MVC. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0438 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0441 \u043d\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a \u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<br \/>  \u0415\u0441\u043b\u0438 \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0438 \u043f\u0440\u043e \u00ab\u0437\u0430 \u0438 \u043f\u0440\u043e\u0442\u0438\u0432\u00bb, \u0442\u043e \u0441\u043f\u0435\u0448\u0443 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 <a href=\"http:\/\/habrahabr.ru\/post\/121132\/\">Entity Framework Code First<\/a>. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u044f \u0443\u0434\u0435\u043b\u044f\u044e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0435 \u0438 \u043d\u0435 \u0442\u0440\u0430\u0447\u0443 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u041d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c \u0441\u044e\u0440\u043f\u0440\u0438\u0437\u043e\u043c \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0441\u0442\u0430\u043b\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb \u0443 Entity Framework \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u043e \u043f\u043e\u043b\u044f\u043c, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0438 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u043c \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043c\u043d\u043e\u0433\u043e\u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u0433\u0443\u0433\u043b\u0435\u043d\u0438\u044f, \u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0432 \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u043e StackOverflow \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u043e\u0432, \u044f \u043f\u0440\u0438\u0448\u0435\u043b \u043a \u0432\u044b\u0432\u043e\u0434\u0443, \u0447\u0442\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0433\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u043e\u0431 \u044d\u0442\u043e\u043c \u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c \u0434\u0430\u043b\u0435\u0435.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h5>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h5>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u043b\u044e\u0431\u043e\u0439 \u043d\u043e\u0432\u044b\u0439 (\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439) \u043f\u0440\u043e\u0435\u043a\u0442. \u0412 Code First \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0445\u043e\u0440\u043e\u0448\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">public class SomeClass { public int Id { get; set; }  [Index] public string Name { get; set; }  [FullTextIndex] public string Description { get; set; } } <\/code><\/pre>\n<p>  \u043f\u0440\u0438 \u044d\u0442\u043e\u043c, \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c DatabaseInitializer \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0447\u0438\u0435 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<p>  \u0412 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Visual Studio 2013 Ultimate. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 Class Library, \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0435\u0433\u043e Entity Framework 6 Beta 1 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e NuGet \u043a\u043e\u043d\u0441\u043e\u043b\u0438 (Package Manager Console):<\/p>\n<p>  <i>PM&gt; Install-Package EntityFramework -Pre<\/i><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b Index \u0438 FullTextSearch, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f FullTextSearch:  <\/p>\n<pre><code class=\"cs\">public class IndexAttribute : Attribute { }  public class FullTextIndexAttribute : Attribute { } public class FullTextIndex { public enum SearchAlgorithm { Contains, FreeText } } <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0412\u044b \u0440\u0430\u043d\u0435\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u043f\u043e\u0438\u0441\u043a\u043e\u043c, \u0442\u043e \u0412\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u043f\u043e\u043d\u044f\u043b\u0438 \u0437\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d Contains \u0438 FreeText, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0412\u0430\u043c <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms142559(v=sql.105).aspx\">\u0441\u044e\u0434\u0430<\/a>. <br \/>  \u0414\u0430\u043b\u0435\u0435, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0442 DbContext:  <\/p>\n<pre><code class=\"cs\">public abstract class DbContextIndexed : DbContext { private static bool Complete; private int? language;  public int Language { get { return language.HasValue ? language.Value : 1049; \/\/1049 - \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a } set { language = value; } }  protected override void Dispose(bool disposing) { if (!Complete) { Complete = true; CalculateIndexes(); }  base.Dispose(disposing); }  private void CalculateIndexes() { if (GetCompleteFlag()) return;  \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0441\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e DbContext foreach (var property in this.GetType().GetProperties().Where(f =&gt; f.PropertyType.BaseType != null && f.PropertyType.BaseType.Name == &quot;DbQuery`1&quot;)) { var currentEntityType = property.PropertyType.GetGenericArguments().FirstOrDefault(); if (currentEntityType == null || currentEntityType.BaseType.FullName != &quot;System.Object&quot;) continue;  \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0411\u0414 var tableAttribute = currentEntityType.GetCustomAttributes(typeof(TableAttribute), false).FirstOrDefault() as TableAttribute; var tableName = tableAttribute != null ? tableAttribute.Name : property.Name;  \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u044b\u0435 \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c Index, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e \u043d\u0438\u043c \u0438\u043d\u0434\u0435\u043a\u0441 BuildingIndexes(tableName, currentEntityType.GetProperties().Where(f =&gt; f.GetCustomAttributes(typeof(IndexAttribute), false).Any()));  \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u044b\u0435 \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c FullTextIndex, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e \u043d\u0438\u043c \u0438\u043d\u0434\u0435\u043a\u0441 BuildingFullTextIndexes(tableName, currentEntityType.GetProperties().Where(f =&gt; f.GetCustomAttributes(typeof(FullTextIndexAttribute), false).Any())); }  CreateCompleteFlag(); }  private void BuildingIndexes(string tableName, IEnumerable&lt;PropertyInfo&gt; propertyes) { foreach (var property in propertyes) Database.ExecuteSqlCommand(String.Format(&quot;CREATE INDEX IX_{0} ON {1} ({0})&quot;, property.Name, tableName)); \/\/\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441 }  private void BuildingFullTextIndexes(string tableName, IEnumerable&lt;PropertyInfo&gt; propertyes) { var fullTextColumns = string.Empty; foreach (var property in propertyes) fullTextColumns += String.Format(&quot;{0}{1} language {2}&quot;, (string.IsNullOrWhiteSpace(fullTextColumns) ? null : &quot;,&quot;), property.Name, Language);  \/\/\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, String.Format(&quot;IF NOT EXISTS (SELECT * FROM sysindexes WHERE id=object_id('{1}') and name='IX_{2}') CREATE UNIQUE INDEX IX_{2} ON {1} ({2});CREATE FULLTEXT CATALOG FTXC_{1} AS DEFAULT;CREATE FULLTEXT INDEX ON {1}({0}) KEY INDEX [IX_{2}] ON ([FTXC_{1}]) WITH STOPLIST = SYSTEM;&quot;, fullTextColumns, tableName, &quot;Id&quot;)); }  private void CreateCompleteFlag() { Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, &quot;CREATE TABLE [dbo].[__IndexBuildingHistory]([DataContext] [nvarchar](255) NOT NULL, [Complete] [bit] NOT NULL, CONSTRAINT [PK___IndexBuildingHistory] PRIMARY KEY CLUSTERED ([DataContext] ASC))&quot;); }  private bool GetCompleteFlag() { var queryResult = Database.SqlQuery(typeof(string), &quot;IF OBJECT_ID('__IndexBuildingHistory', 'U') IS NOT NULL SELECT 'True' AS 'Result' ELSE SELECT 'False' AS 'Result'&quot;).GetEnumerator(); queryResult.MoveNext(); return bool.Parse(queryResult.Current as string); } } <\/code><\/pre>\n<p>  \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0440\u0430\u0437\u0434\u0443\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u0442, \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0443\u0431\u0440\u0430\u043d\u044b summary \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u043f\u043e\u043b\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u0430 <a href=\"https:\/\/github.com\/Razario\/EntityFrameworkIndex.git\">GitHab&#8217;e<\/a>. \u0415\u0441\u043b\u0438 \u043a\u0440\u0430\u0442\u043a\u043e \u043f\u043e\u044f\u0441\u043d\u0438\u0442\u044c, \u0442\u043e EF \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u043c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a DbContext&#8217;\u0443, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u043d\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u0445 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 DbContext. \u0414\u0430\u043b\u0435\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043d\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0411\u0414 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u043e\u0439 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f, \u0432 \u043b\u0443\u0447\u0448\u0438\u0445 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u044f\u0445 EF \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u0431\u0430\u0437\u0435 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 __IndexBuildingHistory, \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439, \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u0438\u0434\u0435\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e.<\/p>\n<p>  \u0412 \u0446\u0435\u043b\u043e\u043c, \u0435\u0441\u043b\u0438 \u0443\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c, \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c \u0435\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442, \u0442\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u044b, \u043e\u0434\u043d\u0430\u043a\u043e, \u043d\u0430\u043c \u0435\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430, \u0434\u043b\u044f \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 (extension class):  <\/p>\n<pre><code class=\"cs\">public static class IQueryableExtension { public static IQueryable&lt;T&gt; FullTextSearch&lt;T&gt;(this DbSet&lt;T&gt; queryable, Expression&lt;Func&lt;T, bool&gt;&gt; func, FullTextIndex.SearchAlgorithm algorithm = FullTextIndex.SearchAlgorithm.FreeText) where T : class { var internalSet = queryable.AsQueryable().GetType().GetProperty(&quot;System.Data.Entity.Internal.Linq.IInternalSetAdapter.InternalSet&quot;, BindingFlags.NonPublic | BindingFlags.Instance).GetValue(queryable.AsQueryable()); var entitySet = (EntitySet)internalSet.GetType().GetProperty(&quot;EntitySet&quot;).GetValue(internalSet);  var searchType = algorithm == FullTextIndex.SearchAlgorithm.Contains ? &quot;CONTAINS&quot; : &quot;FREETEXT&quot;; var columnName = ((MemberExpression)((BinaryExpression)func.Body).Left).Member.Name; var searchPattern = ((ConstantExpression)((BinaryExpression)func.Body).Right).Value;  return queryable.SqlQuery(String.Format(&quot;SELECT * FROM {0} WHERE {1};&quot;, entitySet.Name, String.Format(&quot;{0}({1},'{2}')&quot;, searchType, columnName, searchPattern))).AsQueryable(); } } <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0442\u0430\u043a\u0430\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043a\u0430\u043a \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0435\u0439 Entity Framework, \u043e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u043d\u0435 \u0431\u044b\u043b\u043e. \u0414\u0430\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u043b\u0438\u0445\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u0435\u0442 <i>\u043c\u043e\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/i> \u043a \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 \u0412\u0430\u043c \u0447\u0435\u0433\u043e \u0442\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 (\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u043e\u043f-\u0441\u043b\u043e\u0432 \u0438 \u0442.\u0434.), \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 GitHab&#8217;a \u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043b\u0438\u0431\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u0435. \u0421\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u0431\u044b \u0441\u043e\u0432\u0441\u0435\u043c \u0441\u043a\u0443\u0447\u043d\u043e\u0439, \u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u043d\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u043a\u0430\u043a \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e.<\/p>\n<h5>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/h5>\n<p>  1. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442 Console application<br \/>  2. \u0414\u043e\u0431\u0430\u0432\u0438\u043c Entity Framework 6 beta \u0447\u0435\u0440\u0435\u0437 NuGet<br \/>  3. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 (\u0435\u0441\u043b\u0438 \u0412\u044b \u043d\u0435 \u0447\u0438\u0442\u0430\u043b\u0438 \u043f\u0440\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u0442\u043e \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u0441\u0441\u044b\u043b\u043a\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438)<br \/>  4. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c, \u0431\u0435\u0437 \u0432\u043b\u043e\u0436\u0435\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u0441\u0432\u044f\u0437\u0435\u0439, \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e:  <\/p>\n<pre><code class=\"cs\">public class Animal { public int Id { get; set; }  [Index] [StringLength(200)] public string Name { get; set; }  [FullTextIndex] public string Description { get; set; }  public int Family { get; set; }  [FullTextIndex] public string AdditionalDescription { get; set; } } <\/code><\/pre>\n<p>  \u0421\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0436\u0438\u0432\u043e\u0442\u043d\u043e\u0435, \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c (Name), \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c (Description) \u2014 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u0434\u043b\u044f \u0432\u0438\u0434\u0430, \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0443 [StringLength(200)], \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u043c \u043f\u043e\u043b\u044f\u043c \u043e\u043d\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430, \u0442.\u043a. MSSQL \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u043f\u043e \u043f\u043e\u043b\u044f\u043c, \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 900 \u0431\u0430\u0439\u0442 \u2014 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u0445, \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0412\u0430\u043c\u0438 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  5. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445:  <\/p>\n<pre><code class=\"cs\">public class DataContext : DbContextIndexed { public DbSet&lt;Animal&gt; Animals { get; set; } } <\/code><\/pre>\n<p>  \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0437\u0434\u0435\u0441\u044c \u0432 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438, \u043e\u0431\u044b\u0447\u043d\u043e \u0412\u044b \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0435\u0441\u044c \u043e\u0442 DbContext, \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0442 \u043d\u0430\u0448\u0435\u0439 DbContextIndexed<\/p>\n<p>  6. \u0412 Programm.cs \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443, \u0447\u0442\u043e\u0431\u044b \u0441\u043f\u0440\u043e\u0432\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445:  <\/p>\n<pre><code class=\"cs\">static void Main(string[] args) { using (var context = new DataContext()) { var temp = context.Animals.ToList(); } } <\/code><\/pre>\n<p>  7. \u0412 config \u0444\u0430\u0439\u043b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u0440\u043e\u043f\u0438\u0448\u0438\u0442\u0435 \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 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c DataContext:  <\/p>\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;configuration&gt; &lt;startup&gt;  &lt;supportedRuntime version=&quot;v4.0&quot; sku=&quot;.NETFramework,Version=v4.5&quot;\/&gt; &lt;\/startup&gt; &lt;connectionStrings&gt; &lt;add name=&quot;DataContext&quot; connectionString=&quot;Data Source=(local)\\SQL; Initial Catalog=EFCF; Integrated Security=true;&quot; providerName=&quot;System.Data.SqlClient&quot;\/&gt; &lt;\/connectionStrings&gt; &lt;\/configuration&gt; <\/code><\/pre>\n<p>  8. \u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c F5, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Managment Studio \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043a\u0430\u043a \u043c\u044b \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/b8d\/00f\/799\/b8d00f799c5d5647a026fa40025d6025.jpg\" alt=\"image\"\/><\/p>\n<p>  9. \u0422\u0435\u043f\u0435\u0440\u044c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a:  <\/p>\n<pre><code class=\"cs\">using (var context = new DataContext()) { context.Animals.Add(new Animal { Name = &quot;\u041a\u043e\u0442&quot;, Description = &quot;\u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0443 \u043a\u043e\u0448\u0430\u0447\u044c\u0438\u0445, \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u044f\u0442 \u0432\u0438\u0441\u043a\u0430\u0441.&quot; }); context.Animals.Add(new Animal { Name = &quot;\u041b\u0435\u0432&quot;, Description = &quot;\u041b\u0435\u0432 \u043f\u043e \u043f\u0440\u0430\u0432\u0443 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u043e\u043b\u0435\u043c \u0437\u0432\u0435\u0440\u0435\u0439, \u0441\u0430\u043c\u044b\u0439 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u0442\u043e\u0432.&quot; }); context.Animals.Add(new Animal { Name = &quot;\u041f\u0430\u043d\u0442\u0435\u0440\u0430&quot;, Description = &quot;\u041f\u0430\u043d\u0442\u0435\u0440\u0430 - \u044d\u0442\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u0447\u0435\u0440\u043d\u0430\u044f \u043a\u043e\u0448\u043a\u0430.&quot; }); context.Animals.Add(new Animal { Name = &quot;\u0422\u0438\u0433\u0440&quot;, Description = &quot;\u0411\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u043b\u043e\u0441\u0430\u0442\u044b\u0439 \u043a\u043e\u0442.&quot; }); context.Animals.Add(new Animal { Name = &quot;\u041f\u0438\u0442\u0431\u0443\u043b\u044c&quot;, Description = &quot;\u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0431\u043e\u0439\u0446\u043e\u0432\u0430\u044f \u0441\u043e\u0431\u0430\u043a\u0430.&quot; }); context.Animals.Add(new Animal { Name = &quot;\u0410\u043c\u0435\u0440\u0438\u043a\u0430\u043d\u0441\u043a\u0438\u0439 \u0441\u0442\u0430\u0444\u0430\u0440\u0434\u0448\u0438\u0440\u0441\u043a\u0438\u0439 \u0442\u0435\u0440\u044c\u0435\u0440&quot;, Description = &quot;\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u043b \u043e\u0442 \u043f\u0438\u0442\u0431\u0443\u043b\u044f, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0439 \u0431\u043e\u0439\u0446\u043e\u0432\u043e\u0439 \u0441\u043e\u0431\u0430\u043a\u0438.&quot; }); context.SaveChanges(); } <\/code><\/pre>\n<p>  \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c \u0432 \u0411\u0414, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c:  <\/p>\n<pre><code class=\"cs\">using (var context = new DataContext()) { foreach (var pet in context.Animals.FullTextSearch(f =&gt; f.Description == &quot;\u043a\u043e\u0442\u044b&quot;)) Console.WriteLine(&quot;{0} - {1}&quot;, pet.Name, pet.Description); } <\/code><\/pre>\n<p>  \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/24e\/a47\/bff\/24ea47bff48af62b4a425446937992fd.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0423 \u043c\u0435\u043d\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f MSSQL 2008R2, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u0439, \u043d\u043e \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439. \u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u0437\u043d\u0430\u044e \u0432 2013-\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u044b \u0431\u044b \u0435\u0449\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u043d\u0442\u0435\u0440\u0430, \u0442.\u043a. \u00ab\u043a\u043e\u0448\u043a\u0430\u00bb, \u0442\u043e\u0436\u0435 \u0431\u044b \u0443\u0447\u043b\u043e\u0441\u044c.<\/p>\n<p>  \u042f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c, \u0438 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u00ab\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u00bb \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0438 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u043f\u043e \u043f\u043e\u043b\u044f\u043c. \u0414\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f 95% \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043d\u043e \u044f \u0438\u0441\u043a\u0440\u0435\u043d\u043d\u0435 \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0438 Entity Framework \u0432\u0441\u0435 \u0442\u0430\u043a\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u00ab\u0432 \u043a\u043e\u0440\u043e\u0431\u043a\u0435\u00bb.<\/p>\n<h5>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/h5>\n<p>  \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443:<br \/>  <a href=\"http:\/\/files.mail.ru\/197CD865C5384D9D94DC3E24AC888D86\">\u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 zip<\/a><br \/>  <a href=\"http:\/\/files.mail.ru\/F2A1169395A8488EB3BD6E911753A465\"> \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 dll<\/a><br \/>  \u041f\u0440\u043e\u0435\u043a\u0442 \u0432\u044b\u043b\u043e\u0436\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/Razario\/EntityFrameworkIndex.git\">GitHab<\/a><br \/>  Entity Framework 6 beta \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/www.nuget.org\/packages\/EntityFramework\/6.0.0-beta1\">Nuget<\/a> \t\t\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\/189806\/\"> http:\/\/habrahabr.ru\/post\/189806\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/812\/622\/991\/812622991738384883b48c1847acfe67.jpg\" alt=\"image\"\/><\/p>\n<p>  \u041f\u043e \u0440\u043e\u0434\u0443 \u043c\u043e\u0435\u0439 \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043c\u043d\u0435 \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u044d\u0442\u043e \u0441\u0430\u0439\u0442\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 ASP.NET MVC. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0438 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0441 \u043d\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a \u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<br \/>  \u0415\u0441\u043b\u0438 \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0438 \u043f\u0440\u043e \u00ab\u0437\u0430 \u0438 \u043f\u0440\u043e\u0442\u0438\u0432\u00bb, \u0442\u043e \u0441\u043f\u0435\u0448\u0443 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 <a href=\"http:\/\/habrahabr.ru\/post\/121132\/\">Entity Framework Code First<\/a>. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u044f \u0443\u0434\u0435\u043b\u044f\u044e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0435 \u0438 \u043d\u0435 \u0442\u0440\u0430\u0447\u0443 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u041d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c \u0441\u044e\u0440\u043f\u0440\u0438\u0437\u043e\u043c \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0441\u0442\u0430\u043b\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb \u0443 Entity Framework \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u043e \u043f\u043e\u043b\u044f\u043c, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0438 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u043c \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043c\u043d\u043e\u0433\u043e\u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u0433\u0443\u0433\u043b\u0435\u043d\u0438\u044f, \u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0432 \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u043e StackOverflow \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u043e\u0432, \u044f \u043f\u0440\u0438\u0448\u0435\u043b \u043a \u0432\u044b\u0432\u043e\u0434\u0443, \u0447\u0442\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0433\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u043e\u0431 \u044d\u0442\u043e\u043c \u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c \u0434\u0430\u043b\u0435\u0435.  <\/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-189806","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/189806","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=189806"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/189806\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=189806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=189806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=189806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}