<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>EF 4.1 RTW Change to Default MaxLength in Code First</title><link>http://blogs.msdn.com/b/adonet/archive/2011/03/29/ef-4-1-rtw-change-to-default-maxlength-in-code-first.aspx</link><description>&amp;#160; The information in this post is out of date. Visit msdn.com/data/ef for the latest information on current and past releases of EF. &amp;#160; We recently announced the release of ADO.NET Entity Framework 4.1 Release Candidate which included the first</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: EF 4.1 RTW Change to Default MaxLength in Code First</title><link>http://blogs.msdn.com/b/adonet/archive/2011/03/29/ef-4-1-rtw-change-to-default-maxlength-in-code-first.aspx#10157777</link><pubDate>Mon, 25 Apr 2011 18:03:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10157777</guid><dc:creator>David Nelson</dc:creator><description>&lt;p&gt;As Jon Miller said, varchar(max) columns cannot be indexed. There are also known performance issues when querying varchar(max) columns: there is additional overhead both at the server level and at the TDS protocol level (used by the SQL native client). Using a constant number (e.g. varchar(4000)) would be better.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10157777" width="1" height="1"&gt;</description></item><item><title>re: EF 4.1 RTW Change to Default MaxLength in Code First</title><link>http://blogs.msdn.com/b/adonet/archive/2011/03/29/ef-4-1-rtw-change-to-default-maxlength-in-code-first.aspx#10156705</link><pubDate>Thu, 21 Apr 2011 15:15:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10156705</guid><dc:creator>Leniel Macaferi</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I think I have a bug for you in respect to the Image data type of SQL CE and Entity Framework 4.1. Take a look at the question I posted at StackOverflow:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://stackoverflow.com/q/5737733/114029"&gt;stackoverflow.com/.../114029&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I solved the problem using the 1st approach described in this post.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Leniel&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10156705" width="1" height="1"&gt;</description></item><item><title>re: EF 4.1 RTW Change to Default MaxLength in Code First</title><link>http://blogs.msdn.com/b/adonet/archive/2011/03/29/ef-4-1-rtw-change-to-default-maxlength-in-code-first.aspx#10151920</link><pubDate>Mon, 11 Apr 2011 05:56:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10151920</guid><dc:creator>EF Code First and Concurrency</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Today, I realised that when I issued the command Submitchanges(), the EF code first wont just update the table it&amp;#39;s supposed to be, but also does a cascade update across the foreign key tables too.&lt;/p&gt;
&lt;p&gt;1. Why does it do that?&lt;/p&gt;
&lt;p&gt;2. Is there any way to prevent that? cause it&amp;#39;s causing Optimistic Concurrency Exception in my application.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Sam&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10151920" width="1" height="1"&gt;</description></item><item><title>re: EF 4.1 RTW Change to Default MaxLength in Code First</title><link>http://blogs.msdn.com/b/adonet/archive/2011/03/29/ef-4-1-rtw-change-to-default-maxlength-in-code-first.aspx#10151883</link><pubDate>Mon, 11 Apr 2011 00:28:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10151883</guid><dc:creator>Can not write seed（） in database</dc:creator><description>&lt;p&gt;After update EF4.1，Can not write data in database。why？&lt;/p&gt;
&lt;p&gt;-----------------------------------------------------------------------------------------------------------------------------from china&lt;/p&gt;
&lt;p&gt;如题：升级到EF4.1 RC 后 seed（）方法里面的数据无法写入到 数据库中&lt;/p&gt;
&lt;p&gt;我的测试项目升级到EF4.1 RC 后 seed（）方法里面的数据无法写入到 数据库中。大师们有没有类似的问题啊：&lt;/p&gt;
&lt;p&gt;DBInitializer代码----：&lt;/p&gt;
&lt;p&gt; 1 public class DBInitializer : DropCreateDatabaseIfModelChanges&amp;lt;ConferenceMSEntitiesContext&amp;gt;&lt;/p&gt;
&lt;p&gt; 2 &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; 3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protected override void Seed(ConferenceMSEntitiesContext context)&lt;/p&gt;
&lt;p&gt; 4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; 5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var de = new List&amp;lt;Department&amp;gt; {&lt;/p&gt;
&lt;p&gt; 6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new Department{&lt;/p&gt;
&lt;p&gt; 7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Name=&amp;quot;小庙&amp;quot;,&lt;/p&gt;
&lt;p&gt; 8 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DepartmentTypeID=1&lt;/p&gt;
&lt;p&gt; 9 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/p&gt;
&lt;p&gt;10 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new Department{&lt;/p&gt;
&lt;p&gt;11 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Name=&amp;quot;经济局&amp;quot;,&lt;/p&gt;
&lt;p&gt;12 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DepartmentTypeID=3&lt;/p&gt;
&lt;p&gt;13 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/p&gt;
&lt;p&gt;14 &amp;nbsp;&lt;/p&gt;
&lt;p&gt;15 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new Department{&lt;/p&gt;
&lt;p&gt;16 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Name=&amp;quot;发改局&amp;quot;,&lt;/p&gt;
&lt;p&gt;17 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DepartmentTypeID=3,&lt;/p&gt;
&lt;p&gt;18 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;19 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt;20 &lt;/p&gt;
&lt;p&gt;21 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/p&gt;
&lt;p&gt;22 &lt;/p&gt;
&lt;p&gt;23 &amp;nbsp; &lt;/p&gt;
&lt;p&gt;24 &lt;/p&gt;
&lt;p&gt;25 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; de.ForEach(d =&amp;gt; context.Departments.Add(d));&lt;/p&gt;
&lt;p&gt;26 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/p&gt;
&lt;p&gt;27 &lt;/p&gt;
&lt;p&gt;28 &lt;/p&gt;
&lt;p&gt;29 &amp;nbsp; &lt;/p&gt;
&lt;p&gt;30 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;31 &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;32 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt;33 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;34 &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt;35 }&lt;/p&gt;
&lt;p&gt;以上代码最后不论是否添加 &amp;nbsp; &amp;nbsp; base.Seed(context); 和 &amp;nbsp;context.SaveChanges(); 这两行代码，都无法把数据写进数据库。&lt;/p&gt;
&lt;p&gt;Application_Start-----------------&lt;/p&gt;
&lt;p&gt; 1 &amp;nbsp;protected void Application_Start()&lt;/p&gt;
&lt;p&gt; 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; 3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/p&gt;
&lt;p&gt; 4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.Data.Entity.Database.SetInitializer&amp;lt;ConferenceMSEntitiesContext&amp;gt;(new DBInitializer());&lt;/p&gt;
&lt;p&gt; 5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/p&gt;
&lt;p&gt; 6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AreaRegistration.RegisterAllAreas();&lt;/p&gt;
&lt;p&gt; 7 &lt;/p&gt;
&lt;p&gt; 8 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RegisterGlobalFilters(GlobalFilters.Filters);&lt;/p&gt;
&lt;p&gt; 9 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RegisterRoutes(RouteTable.Routes);&lt;/p&gt;
&lt;p&gt;10 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10151883" width="1" height="1"&gt;</description></item><item><title>re: EF 4.1 RTW Change to Default MaxLength in Code First</title><link>http://blogs.msdn.com/b/adonet/archive/2011/03/29/ef-4-1-rtw-change-to-default-maxlength-in-code-first.aspx#10150413</link><pubDate>Wed, 06 Apr 2011 11:46:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10150413</guid><dc:creator>Richard</dc:creator><description>&lt;p&gt;What about third-party providers? For example, MySql doesn&amp;#39;t have a varchar(MAX) type, but presumably won&amp;#39;t use the SQL Compact convention. Since you&amp;#39;ve removed the ability to add custom conventions for code-first, how will EF4.1 handle this?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10150413" width="1" height="1"&gt;</description></item><item><title>re: EF 4.1 RTW Change to Default MaxLength in Code First</title><link>http://blogs.msdn.com/b/adonet/archive/2011/03/29/ef-4-1-rtw-change-to-default-maxlength-in-code-first.aspx#10149514</link><pubDate>Mon, 04 Apr 2011 14:29:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10149514</guid><dc:creator>Jon Miller2</dc:creator><description>&lt;p&gt;One issue that I see with changing it to MAX is that you can&amp;#39;t index those columns. It seems like you should set it to the max value that is allowed for an indexable column. Also, I&amp;#39;m not sure what the performance implications of having it set to MAX would be.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10149514" width="1" height="1"&gt;</description></item><item><title>re: EF 4.1 RTW Change to Default MaxLength in Code First</title><link>http://blogs.msdn.com/b/adonet/archive/2011/03/29/ef-4-1-rtw-change-to-default-maxlength-in-code-first.aspx#10149020</link><pubDate>Fri, 01 Apr 2011 23:22:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10149020</guid><dc:creator>Will</dc:creator><description>&lt;p&gt;Thanks for the info. That sounds like the best course of action to me. I did not like the arbitrary 128 character default but will probably try to set a default.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10149020" width="1" height="1"&gt;</description></item><item><title>re: EF 4.1 RTW Change to Default MaxLength in Code First</title><link>http://blogs.msdn.com/b/adonet/archive/2011/03/29/ef-4-1-rtw-change-to-default-maxlength-in-code-first.aspx#10148870</link><pubDate>Fri, 01 Apr 2011 16:50:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10148870</guid><dc:creator>Kyralessa</dc:creator><description>&lt;p&gt;What&amp;#39;s the best way to send feedback? &amp;nbsp;I have a scenario that doesn&amp;#39;t work in EF, and I&amp;#39;d love to send a description to someone on the product team, but it seems a bit long for a blog comment.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10148870" width="1" height="1"&gt;</description></item><item><title>re: EF 4.1 RTW Change to Default MaxLength in Code First</title><link>http://blogs.msdn.com/b/adonet/archive/2011/03/29/ef-4-1-rtw-change-to-default-maxlength-in-code-first.aspx#10148635</link><pubDate>Fri, 01 Apr 2011 08:50:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10148635</guid><dc:creator>Thijs Kampen</dc:creator><description>&lt;p&gt;Good news. From this post I understand you are in the fase of fixing bugs. Is it possible to share some news on the bugfixes regarding multilevel TPH inheritance when using abstract classes? &amp;nbsp; &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10148635" width="1" height="1"&gt;</description></item><item><title>re: EF 4.1 RTW Change to Default MaxLength in Code First</title><link>http://blogs.msdn.com/b/adonet/archive/2011/03/29/ef-4-1-rtw-change-to-default-maxlength-in-code-first.aspx#10148465</link><pubDate>Thu, 31 Mar 2011 22:17:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10148465</guid><dc:creator>Terrence_</dc:creator><description>&lt;p&gt;That solution sounds fine to me.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10148465" width="1" height="1"&gt;</description></item></channel></rss>