<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Adding a New Field to the Movie Model and Table</title><link>http://asp.net</link><pubDate>Thu, 06 Jun 2013 20:18:02 GMT</pubDate><generator>umbraco</generator><description>Comments for Adding a New Field to the Movie Model and Table</description><language>en</language><atom:link href="http://asp.net/rss/comments/37159" rel="self" type="application/rss+xml" /><item><title>Comment Posted by juliandormon</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Tue, 21 Aug 2012 16:12:47 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016240</guid><description><![CDATA[ <p>After deleting the DB and the pasting your code into the Package Manager Controls I get the following error:</p><p></p><p>PM&gt; Enable-Migrations -ContextTypeName MvcMovie.Models.MovieDBContext</p><p>The project &#39;MvcMovie&#39; failed to build.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/juliandormon.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by rmlysik</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Mon, 27 Aug 2012 13:37:45 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016300</guid><description><![CDATA[ <p>In addition to deleting the Movies.mdf file as stated in the beginning of this section, I also needed to drop the database before I could successfully execute the statement &quot;update-database&quot; from the Package manager Console. I had been getting the error Cannot attach the file &#39;...\Movies.mdf&#39; as database &#39;Movies&#39;.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/rmlysik.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by bnazeem</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Mon, 27 Aug 2012 19:39:45 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016312</guid><description><![CDATA[ <p>follow-up to my last comment to this error:</p><p>PM&gt; Enable-Migrations -ContextTypeName MvcMovie.Models.MovieDBContext</p><p></p><p>Enable-Migrations : A parameter cannot be found that matches parameter name &#39;ContextTypeName&#39;.</p><p></p><p>At line:1 char:35</p><p></p><p>+ Enable-Migrations -ContextTypeName &lt;&lt;&lt;&lt; MvcMovie.Models.MovieDBContext</p><p>+ CategoryInfo : InvalidArgument: (:) [Enable-Migrations], ParameterBindingException</p><p>+ FullyQualifiedErrorId : Named</p><p>I did update to the latest EntityFramework through &quot;Manage Nuget P and it works.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/bnazeem.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ricka6</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Mon, 27 Aug 2012 20:52:55 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016315</guid><description><![CDATA[ <p>@juliandormon --The project &#39;MvcMovie&#39; failed to build.</p><p>Fix the build (compile problems). I updated the instructions.</p><p></p><p>@rmlysik -- , I also needed to drop the database before </p><p>Thanks, I updated the instructions to include dropping the DB first.</p><p></p><p>@bnazeem - Enable-Migrations : A parameter cannot be found that matches parameter name &#39;ContextTypeName&#39;.</p><p>Thanks for posting the problem/solution.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/ricka6.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by virshu</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Sun, 09 Sep 2012 22:29:40 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016403</guid><description><![CDATA[ <p>Thank you for covering new features of Entity Framework. Looking forward to MVC 4 tutorial as well that would be useful to MVC developers interested to learn new MVC 4 features. </p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/virshu.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ZAiNT</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Sun, 18 Nov 2012 17:55:14 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016824</guid><description><![CDATA[ <p>Rick: Why are you using Enable-Migrations -ContextTypeName MvcMovie.Models.MovieDBContext? Why not simply use Enable-Migrations? In the past before reading this article the only thing you needed to do was Enable-Migrations. The ContextTypeName made me confused.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/ZAiNT.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ricka6</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Tue, 20 Nov 2012 13:35:25 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016837</guid><description><![CDATA[ <p>@ZAiNT : -ContextTypeName </p><p>Membership db now has a context class too, so there are two when you create one and you have to specify the context class in the enable-migrations command.  Previously they didn’t have a context class for the membership db so you didn&#39;t need to specify which context class to apply migrations.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/ricka6.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by thronedoggie</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Mon, 03 Dec 2012 10:30:23 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016921</guid><description><![CDATA[ <p>Rick - Love the tutorial. </p><p></p><p>Can&#39;t help but wonder why, in the above example after adding Rio Bravo II, all of the other movies show up as &quot;R&quot;?</p><p></p><p>(And I can&#39;t believe that WHMS is rated &quot;G&quot;. Didn&#39;t Meg do her impression of a faked orgasm in the restaurant? : )</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/thronedoggie.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by DeveloperPR</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Wed, 05 Dec 2012 19:43:31 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016945</guid><description><![CDATA[ <p>Hi,</p><p></p><p>I really want to know how to use this approach:</p><p></p><p>&quot;Explicitly modify the schema of the existing database so that it matches the model classes. The advantage of this approach is that you keep your data. You can make this change either manually or by creating a database change script.&quot;</p><p></p><p>Thanks for the help.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/DeveloperPR.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by thecoleorton</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Tue, 11 Dec 2012 14:04:29 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016985</guid><description><![CDATA[ <p>Hi Rick, </p><p></p><p>So, the first step in this tutorial is to delete the existing database. What if you&#39;re wanting to run a migration on an existing database - with existing data?</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/thecoleorton.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ricka6</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Wed, 16 Jan 2013 21:25:36 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018189</guid><description><![CDATA[ <p>@thecoleorton What if you&#39;re wanting to run a migration on an existing database - with existing data?</p><p>The tutorial goes on to explain the migration approach with existing data.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/ricka6.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by RiaanPieterse81</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Tue, 05 Feb 2013 13:30:12 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018347</guid><description><![CDATA[ <p>You also need to update the Delete View, it won&#39;t give any errors, if you don&#39;t the Ratings won&#39;t display on &quot;http://localhost:XXXX/Movies/Delete/X&quot; page.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/RiaanPieterse81.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by salman_sulaiman_1979</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Fri, 08 Feb 2013 00:33:09 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018380</guid><description><![CDATA[ <p>Thanks Rick! Great stuff once again!</p><p>Just a quick note I would like to share, I might be missing something but perhaps it is a typo,not sure.. Rick, in the code snippet where you were specifiying the Migration process and modifying the &quot;Seed&quot; method, in the first code snippet there is this line of code: &quot;context.Movies.AddOrUpdate( i =&gt; i.Title,...&quot;, which didn&#39;t make sense to me because the AddOrUpdate in this case is expecting parameters of type &quot;Movie&quot;, the next code snippet (the one below it immediately worked out fine with me without any trouble. I just thought I would pin point this, perhaps I am missing something, not sure. </p><p>right! just liked to share this really quick, i am continuing with the rest of  the tutorial, simply beautiful! Thanks once again Rick! and good luck folks! really cool comments down here. fantastic!</p><p>Best Wishes,</p><p>~Salman~</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/salman_sulaiman_1979.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by shamimbd0</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Tue, 12 Feb 2013 01:18:07 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018409</guid><description><![CDATA[ <p>Have I need to delete Database every time after adding new Property in class to migrate database?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/shamimbd0.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by abdelkader</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Thu, 21 Feb 2013 12:42:46 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018485</guid><description><![CDATA[ <p>@shamimbd0 : No, you don&#39;t need to drop the database each time you add a new field to your model.  Just type these two commands in the PM to update the db with the model :</p><p></p><p>add-migration WhatEverYouWant</p><p>update-database</p><p></p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/abdelkader.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Danny117</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Wed, 06 Mar 2013 13:28:59 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018590</guid><description><![CDATA[ <p>I made it this far.  Code first migrations argh!</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/Danny117.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by payini</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Mon, 11 Mar 2013 16:17:29 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018650</guid><description><![CDATA[ <p>Great tutorials. Thank you.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/payini.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by render22</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Thu, 28 Mar 2013 11:37:29 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018796</guid><description><![CDATA[ <p>First of all, thanks for the tutorial.</p><p></p><p>This is probably a very dumb question (I&#39;m really new to this), but in the Configuration.cs file example, how are we using i?  What is this parameter saying?  (I understand it&#39;s lambda expression etc, but I don&#39;t understand what it&#39;s purpose is here as I don&#39;t see i being used anywhere else).</p><p></p><p>context.Movies.AddOrUpdate( i =&gt; i.Title,</p><p></p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/render22.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by roixd21</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Wed, 03 Apr 2013 05:43:51 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018839</guid><description><![CDATA[ <p>just as I suspected, now Im using 2012 express web instead of vs2010ultimate, no initial catalog error thrown.. I&#39;m continuing using this express edition :)</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/roixd21.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by CYPT</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Sun, 05 May 2013 13:28:34 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000019040</guid><description><![CDATA[ <p>Great Tutorial, Thank you!</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/CYPT.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by NikolaBoric</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Thu, 16 May 2013 05:52:10 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000019116</guid><description><![CDATA[ <p>If you have the error Cannot attach the file &#39;...\Movies.mdf&#39; as database &#39;Movies&#39;</p><p></p><p>Open the &quot;Developer Command Propmpt for VS2012&quot; under your Start/Programs menu.</p><p></p><p>The run the following commands:</p><p></p><p>sqllocaldb.exe stop v11.0</p><p>sqllocaldb.exe delete v11.0</p><p></p><p>Thanks for this tutorial !</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/NikolaBoric.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ricka6</title><link>http://asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table</link><pubDate>Thu, 06 Jun 2013 20:18:02 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000019262</guid><description><![CDATA[ <p>@salman_sulaiman_1979  -  and @render22 </p><p>code: &quot;context.Movies.AddOrUpdate( i =&gt; i.Title,. </p><p>-- I&#39;ll be updating <a rel="nofollow" href="http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application" target="_blank">www.asp.net/</a> soon where I&#39;ll explain that in detail. </p><p></p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/ricka6.jpg?forceidenticon=false&amp;dt=635073061800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>