<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>Creating Model Classes with the Entity Framework</title><link>http://asp.net</link><pubDate>Wed, 16 Feb 2011 21:37:04 GMT</pubDate><generator>umbraco</generator><description>Comments for Creating Model Classes with the Entity Framework</description><language>en</language><atom:link href="http://asp.net/rss/comments/27576" rel="self" type="application/rss+xml" /><item><title>Comment Posted by anas</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Thu, 06 May 2010 10:43:35 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000008900</guid><description><![CDATA[ <p>Thank you !</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/anas.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by flyinhawaiian84</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Thu, 15 Jul 2010 10:32:38 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009463</guid><description><![CDATA[ <p>Seems to be missing a step.   Figure 8 shows the Add view but where&#39;s the step to create the view?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/flyinhawaiian84.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by flyinhawaiian84</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Fri, 16 Jul 2010 10:36:51 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009476</guid><description><![CDATA[ <p>When the table and columns are being created, Id column must be adjusted.  Under column properties, Identity Specification, set &quot;Is Identity&quot; to Yes.  Set &quot;Identity Increment&quot; to 1.  Set Identity Seed to 1.   If you don&#39;t do this, you&#39;ll get duplicate key error because the id will default to zero and there&#39;s no way to change it.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/flyinhawaiian84.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by flyinhawaiian84</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Fri, 16 Jul 2010 10:42:03 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009477</guid><description><![CDATA[ <p>Note for VS 2010.   When appropriate, visual studio 2010 will attempt to rename plural names to singular names but sometimes makes mistakes.   So, &quot;Movies&quot; will be automatically renamed to &quot;Movy&quot; when it really should be &quot;Movie&quot;.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/flyinhawaiian84.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by kaansengul</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Wed, 04 Aug 2010 08:30:31 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009742</guid><description><![CDATA[ <p>Hi!</p><p></p><p>Here, Inherits=&quot;System.Web.Mvc.ViewPage&lt;List&lt;MovieEntityApp.Models.Movie&gt;&gt;&quot;, how &quot;Movie&quot; get in the &quot;Models&quot;? When I created the entity &quot;Movie&quot; it stored in the root, &quot;MovieEntityApp&quot;</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/kaansengul.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by kelasings</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Fri, 06 Aug 2010 11:54:09 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009775</guid><description><![CDATA[ <p>Why do all of the examples show one table? I understand that this is a tutorial, but showing AT LEAST two tables with a foreign key relationship would make for a better example for those who are trying to use Entity Framwork in the real world.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/kelasings.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by cgiustinoni</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Tue, 10 Aug 2010 15:00:15 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009821</guid><description><![CDATA[ <p>MoviesDBEntities _db;</p><p></p><p>        public HomeController()</p><p>        {</p><p>            _db = new MoviesDBEntities();</p><p>        }</p><p></p><p></p><p>        public ActionResult Index()</p><p>        {</p><p>            ViewData.Model = _db.MovieSet.ToList();</p><p>            return View();</p><p>        }</p><p></p><p>the ADO.NET Entity Model wizard is not creating a property .MovieSet, does anyone have any ideas how and why</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/cgiustinoni.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by vrpmca</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Thu, 09 Sep 2010 07:12:20 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010174</guid><description><![CDATA[ <p>Hi cgiustinoni,</p><p>&quot;MovieSet&quot; is the entity name, not a common property.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/vrpmca.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by daywatch</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Thu, 23 Sep 2010 13:05:32 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010353</guid><description><![CDATA[ <p>Things in listing 2 does not work. This makes the whole doc un-usable!</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/daywatch.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by mrrgd</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Fri, 24 Sep 2010 05:47:24 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010365</guid><description><![CDATA[ <p>I have to agree with kelsings.  Why only one table.  I have just started using Entity Framework 4 (EF4) with MVC2 with a fairly large database.  My biggest problem is finding information about how to use EF4 with MVC2 without using LINQ, POCO, Repositories, etc.  It would be nice to have some examples or demo&#39;s of MVC2 controller methods in C# that will pull the data directly from multiple EF created models and specific attributes from multiple tables/entities. E.g. If I have a an trip planning application using MVC2, one may need to link EF models/entities (or specific attributes of the models) representing the tbl_tour, tbl_client, tbl_loging, tbl_transport, tbl_coordinator, etc. </p><p></p><p>Thanks for the demo.  I believe it needs to be expanded to provide a more useful examples of using EF4 as the model in a MVC2 application.  I would also update the tutorial to use VS2010.  Examples of using EF4 and MVC2 hard to find so your efforts are appreciated.   </p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/mrrgd.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by alcsharp</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Mon, 04 Oct 2010 10:20:14 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010490</guid><description><![CDATA[ <p>All the examples I&#39;ve seen with Entity Framework and MVC create the Entity Models in the MVC project.  A real world application should separate these into a different project.  Unfortunately when you create the entity model in a different project and then try to use it in a controller you&#39;ll get an ugly run-time error about missing metadata..very frustrating.  I don&#39;t ship software assuming the user is always going to take a single path so I don&#39;t know why that&#39;s acceptable to do with Visual Studio.  </p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/alcsharp.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by namratam</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Mon, 11 Oct 2010 06:51:31 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010575</guid><description><![CDATA[ <p>really good</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/namratam.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by squirrelNut</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Fri, 29 Oct 2010 17:22:16 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010765</guid><description><![CDATA[ <p>OK, I&#39;m missing something...when I clicked on the &quot;Add Movie&quot; link I get the error that Add.aspx or Add.ascx can not be found.  Makes sense to me as there&#39;s nothing in this tutorial to build it.    What do I do wrong?</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/squirrelNut.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by rockin2009</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Sat, 30 Oct 2010 04:38:11 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010768</guid><description><![CDATA[ <p>MoviesDBEntities _db;</p><p></p><p></p><p>public HomeController()</p><p></p><p>{</p><p></p><p>_db = new MoviesDBEntities();</p><p></p><p>}</p><p></p><p></p><p></p><p>public ActionResult Index()</p><p></p><p>{</p><p></p><p>ViewData.Model = _db.MovieSet.ToList();</p><p></p><p>return View();</p><p></p><p>}</p><p>am not gettin db.      MovieSet oly Movies am gettin</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/rockin2009.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by rockin2009</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Sat, 30 Oct 2010 04:46:38 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010769</guid><description><![CDATA[ <p>what is this MovieSet from where its coming..</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/rockin2009.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by jcmcbeth</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Thu, 04 Nov 2010 10:15:20 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010820</guid><description><![CDATA[ <p>When modifying the name of the table, go to the properties for the movie entity and in the Entity Set Name you should set something like &quot;Movie1&quot;.  Change this to MovieSet.  This is why you can&#39;t find MovieSet when trying to use the MovieDbEntities class.</p><p></p><p>Also, the this goes to show you how to create the controller for the Add action but doesn&#39;t show you how to create the view.</p><p></p><p>To get around this I just right clicked on the Home view directory and created a strongly typed view for the Movie model named Add.  I made Id an Identity column in the database and then removed those fields from the Add view.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/jcmcbeth.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by jcmcbeth</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Thu, 04 Nov 2010 10:33:22 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010821</guid><description><![CDATA[ <p>Also when making the Id column an Identity column in the database, make sure you set the StoreGeneratedPattern to &quot;Identity&quot; for the Id column in the entity model as well.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/jcmcbeth.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by mejamz</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Tue, 16 Nov 2010 17:47:10 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010967</guid><description><![CDATA[ <p>I have tried and tried to follow these video examples and all I get are half shod examples... I am not saying the videos are not good; just that they DO NOT include all steps... some of us are beginners.</p><p>When I get thru with listing 2; I am supposed to get Figure 7... I get an ENUM error;</p><p>CS1579: foreach statement cannot operate on variables of type &#39;object&#39; because &#39;object&#39; does not contain a public definition for &#39;GetEnumerator&#39;…Seriously???</p><p></p><p>I am using Web Developer 2010 with MVC 2... why cannot I find videos without gaps of information? All  of the MVC 2 Tutorials (Nerd Dinner, Movies, Sport Shop) I have tried to implement with Web Developer 2010 never get finished because I am unable to overcome the LACK of INFORMATION!!!</p><p>The purpose of these videos I thought was to EDUCATE us. When I have to spend 30+ minutes researching how to get something done when the video should demonstrate it, I tend to close the project until I can locate further educational materials. I purchased ASP.NET MVC 2 Framework by Steven Sanderson, even that book (as good as it is) is missing MAIN areas of information... </p><p>I have basic C++ skills and am learning MVC 2… ever so slowly… I am trying to build three different websites… I know it cannot be as difficult as following these videos… Can you please release a video that INCLUDES ALL the steps?</p><p>I am Frustrated</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/mejamz.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Rob Grainger</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Thu, 18 Nov 2010 09:10:39 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010989</guid><description><![CDATA[ <p>I appreciate people&#39;s frustration with the gaps in these tutorials. However, most of these tutorials do include downloadable materials - and generally they should provide sufficient coverage to get the examples working. Hopefully, the learners may gain additional insight through this, although again that&#39;s really no excuse for the incompleteness.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/Rob%20Grainger.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by hellokelon</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Mon, 29 Nov 2010 20:44:49 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000011078</guid><description><![CDATA[ <p>it&#39;s easy for a beginner 。  thank you . - -.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/hellokelon.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by pradip.bobhate</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Thu, 02 Dec 2010 04:53:17 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000011111</guid><description><![CDATA[ <p>thanks... this is realy usefull</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/pradip.bobhate.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by chrisatpenn</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Mon, 20 Dec 2010 01:46:09 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000011250</guid><description><![CDATA[ <p>I am stuck on the part where I create the controller. When I run the application, I get an error for &quot;Object reference not set to an instance of an object.&quot; pointing to the line ViewData.Model = _db.MovieSet.ToList();</p><p></p><p>Can anyone point me in the direction of where I am doing something wrong?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/chrisatpenn.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Connect</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Thu, 13 Jan 2011 07:46:50 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000011500</guid><description><![CDATA[ <p>It would be better to use:</p><p></p><p>var movie = _db.MovieSet.Single(m =&gt; m.Id == id);</p><p></p><p> instead of </p><p></p><p>var movie = _db.MovieSet.First(m =&gt; m.Id == id);</p><p></p><p>Since the primary key is unique. If it is not you will get an exception using Single() and this should alert you to a problem.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/Connect.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Connect</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Thu, 13 Jan 2011 07:49:17 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000011501</guid><description><![CDATA[ <p>However, Single is not supported by LinqToEntities. Why not?</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/Connect.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ocofre</title><link>http://asp.net/mvc/tutorials/older-versions/models-(data)/creating-model-classes-with-the-entity-framework-cs</link><pubDate>Wed, 16 Feb 2011 21:37:04 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012102</guid><description><![CDATA[ <p>thanks a lot ... this is realy usefull</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/ocofre.jpg?forceidenticon=false&amp;dt=635048368800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>