<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 an Entity Framework Data Model for an ASP.NET MVC Application (1 of 10)</title><link>http://asp.net</link><pubDate>Fri, 27 May 2011 02:18:21 GMT</pubDate><generator>umbraco</generator><description>Comments for Creating an Entity Framework Data Model for an ASP.NET MVC Application (1 of 10)</description><language>en</language><atom:link href="http://asp.net/rss/comments/33308" rel="self" type="application/rss+xml" /><item><title>Comment Posted by maran</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Wed, 13 Apr 2011 15:18:24 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012787</guid><description><![CDATA[ <p>You guys are rock :) </p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/maran.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by vincentliu</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Fri, 15 Apr 2011 00:43:07 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012820</guid><description><![CDATA[ <p>Haven&#39;t seen such a good quality tutorial for a long time. </p><p></p><p>Thank you so much :)</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/vincentliu.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by abussie22</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Mon, 18 Apr 2011 16:06:51 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012857</guid><description><![CDATA[ <p>Good tutorial I&#39;ve been researching EF and MVC and struggling with using the two. You&#39;re tutorial provided a good working example of how to use EF and MVC. I can&#39;t wait to move to the next tutorial; Rocking good job !!</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/abussie22.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by airmaro</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Tue, 19 Apr 2011 17:38:23 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012870</guid><description><![CDATA[ <p>Thanks for the tutorials. </p><p></p><p>In working through them when I copy/paste code from IE9 to VS2010 all the code is on one line and it&#39;s annoying to reformat it. Google Chrome copy/pastes with no formatting issues. Is there a setting in IE that I&#39;m missing?</p><p></p><p>And, yes, I do realize that I can download the completed version. I just prefer to follow along.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/airmaro.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Wed, 20 Apr 2011 17:36:59 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012891</guid><description><![CDATA[ <p>IE9 does that in all the newer tutorials on the ASP.NET due to the method they use for code formatting. You can get the correct behavior by doing this:</p><p>• Hit F12 in your browser.</p><p>• Select the Browser Mode menu, then click Internet Explorer 9 Compatibility View.  </p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by johnnyo_onthego</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Fri, 22 Apr 2011 15:56:21 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012935</guid><description><![CDATA[ <p>I&#39;m very grateful for this tutorial so far, but I ran into one minor issue.  I am not sure it was mentioned in the tutorial somewhere, I apologize if I missed it.  In case someone is not familiar with the EF, you must download the EF and then reference the binary EntityFramework.dll in your project in order to gain access to the DbContext.</p><p></p><p>Thanks,</p><p>John</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/johnnyo_onthego.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Sat, 23 Apr 2011 17:11:11 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012950</guid><description><![CDATA[ <p>@johnnyo onthego - Thanks for the observation. As a result of installing the MVC 3 Tools Update this reference should be automatically set.  (It should also be done automatically for you if you get EF in the NuGet package named &quot;EntityFramework&quot;.) Did you install the Tools Update before starting the tutorial? </p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by mcorneluis</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Mon, 25 Apr 2011 23:25:15 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012971</guid><description><![CDATA[ <p>How do you make your Add Controller page show all those options listed above.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/mcorneluis.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Tue, 26 Apr 2011 01:07:32 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012972</guid><description><![CDATA[ <p>If you aren&#39;t seeing all those options, it&#39;s probably because you have not yet installed the MVC 3 Tools Update.  This is an add-on update to MVC 3 that was just released about two weeks ago.  There is a link for using Web Platform Installer to install it at the top of the tutorial.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by vikp</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Tue, 26 Apr 2011 09:01:21 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012981</guid><description><![CDATA[ <p>How do we go about creating models from database tables? This example generates SQL tables from specified classes, but what if we generate classes from SQL tables? Thank you</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/vikp.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by johnnyo_onthego</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Tue, 26 Apr 2011 13:22:00 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012985</guid><description><![CDATA[ <p>@tdykstra - I did not download the tools update... that&#39;s probably where I missed it... thanks for the update!</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/johnnyo_onthego.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Tue, 26 Apr 2011 13:54:05 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012986</guid><description><![CDATA[ <p>@vikp - For a Database First tutorial see the first of these three series at </p><p><a rel="nofollow" href="http://www.asp.net/entity-framework/tutorials" target="_blank">www.asp.net/</a></p><p>There&#39;s an older Database First MVC tutorial at</p><p><a rel="nofollow" href="http://www.asp.net/mvc/tutorials/creating-model-classes-with-the-entity-framework-cs" target="_blank">www.asp.net/</a></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by eyalb</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Tue, 26 Apr 2011 14:47:47 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012989</guid><description><![CDATA[ <p>when using sqlexpress i get an error</p><p>&quot;Model compatibility cannot be checked because the database does not contain model metadata. Ensure that IncludeMetadataConvention has been added to the DbModelBuilder conventions.&quot;</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/eyalb.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Tue, 26 Apr 2011 15:33:36 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012990</guid><description><![CDATA[ <p>@eyalb - I haven&#39;t seen that error but have not been using Code First with SQL Express very much.  I suggest submitting it to one of the forums listed above or to StackOverflow.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by vikp</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Wed, 27 Apr 2011 17:40:48 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013003</guid><description><![CDATA[ <p>Hi :)</p><p></p><p>The article has said in the &quot;POCO (Plain Old CLR Objects)&quot; chapter that both code first and database first methodologies provide models that inherit from EntityObject class, therefore they are NOT persistence-ignorant. </p><p></p><p>Then it says: &quot;All development approaches of the Entity Framework ..... you&#39;ll use POCO classes.&quot; </p><p></p><p>So do we just use objects that inherit from EntityObject and ignore the fact that they have persistence functionality attached to them? Or am I misunderstanding something?</p><p></p><p>Thank you</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/vikp.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by praetorxyn</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Wed, 27 Apr 2011 20:35:39 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013006</guid><description><![CDATA[ <p>I just have a quick question and this seems the best place to ask it because this is the part of the tutorial it pertains to.</p><p></p><p>Instead of having a DAL folder, say you had a separate project (class library) in the same solution called DAL.  And you also had a separate project (class library) called BLL where you store your repositories.  So the BLL project references the DAL project, which references the ContosoUniversity project to access it&#39;s POCO Models, and the ContosoUniversity project references the BLL project to interact with the repositories.  I think this really enforces a better separation of concerns, because the POCO classes in the main project are totally ignorant of all things entity framework, or that&#39;s my theory at least.</p><p></p><p>The problem I have is, with a setup like this, how can you register the database initilizer in the global.asax file?  You would have to add a reference to the DAL project to do this the same way it&#39;s done above, which would create a circular reference.</p><p></p><p>Thanks in advance for any answers you can provide.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/praetorxyn.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Thu, 28 Apr 2011 19:10:45 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013015</guid><description><![CDATA[ <p>@vikp The first part of that section indicates that Database First and Model First (not Database First and Code First) entity classes inherit from EntityObject by default. This is just a default, you can also use classes that do not inherit from EntityObject with Database First and Model First. The default in Code First is to use entity classes that do not inherit from EntityObject.  </p><p></p><p>@praetorxyn That&#39;s a good question but as it&#39;s outside the scope of these tutorials I&#39;d recommend posing it to StackOverflow or the ASP.NET EF forum.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by marcostaf</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Fri, 29 Apr 2011 06:47:40 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013024</guid><description><![CDATA[ <p>I created, using scaffolding, also the controller for Course and Enrollment.</p><p>I delete a course and I see that also the enrollment that link that course to students has been deleted.</p><p>Perfect!</p><p></p><p>I see that when the Db is genereated, the generator create also the relation in the table Enrollment.</p><p>Great!</p><p></p><p>The relations that it create are:</p><p>- Course_Enrollments</p><p>- Enrollment_Student</p><p></p><p>I don&#39;t understand why the name of the firts relation use pluralization</p><p>(&quot;Course_Enrollments&quot;) and why the the order of the table is inverted respect the &quot;Enrollment_Student&quot;.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/marcostaf.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Fri, 29 Apr 2011 16:43:45 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013036</guid><description><![CDATA[ <p>@marcostaf - In my database, the first of the relations you mention is named Enrollment_Course, and so the order is explainable because both start with Enrollment; I don&#39;t know why you are getting one with Course first and Enrollment pluralized. Are all of your attributes in Course and Enrollment, and all of your context class API calls, the same as what&#39;s in the tutorial?</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Fri, 29 Apr 2011 17:41:39 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013037</guid><description><![CDATA[ <p>Also, thanks to everyone who has offered questions, comments, and compliments. The questions and comments often help identify parts of the tutorial that may need to be made clearer, and the positive responses encourage us to continue producing tutorials like these.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by KKWW</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Sun, 22 May 2011 23:21:13 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013247</guid><description><![CDATA[ <p>Have had no luck getting past service pack 1 install,,, keeps failing not finding devenv.exe.config on windows 7 64, have been searching for soluton.. no luck ....Kkww</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/KKWW.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ninibini1</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Mon, 23 May 2011 15:55:57 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013254</guid><description><![CDATA[ <p>Thanks for another great tutorial.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/ninibini1.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ssathya</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Thu, 26 May 2011 17:27:37 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013285</guid><description><![CDATA[ <p>Great tutorial. Can we get the entire set as a word/mobi/epub document? Would be convenient to store in a ebook reader.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/ssathya.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Thu, 26 May 2011 21:44:33 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013286</guid><description><![CDATA[ <p>@ssathya - We will be providing it in .pdf form and will add a comment here when that&#39;s ready.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by pseudo70</title><link>http://asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</link><pubDate>Fri, 27 May 2011 02:18:21 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013288</guid><description><![CDATA[ <p>I think I have found another error in this tutorial (thanks for changing the previous error). You wrote: &quot;The StudentID property is a foreign key, and the corresponding navigation property is Student. An Enrollment entity is associated with one Student entity, so the property can only hold a single Student entity (unlike the Student.Enrollments navigation property you saw earlier, which can hold multiple Enrollment entities).</p><p></p><p>The CourseID property is a foreign key, and the corresponding navigation property is Course. An Enrollment entity is associated with one Student entity.&quot;</p><p></p><p>In the last paragraph it should mean: &quot;An Enrollment entity is associated with one COURSE entity&quot;. Because your sentence prior the last is related to the relationship between Course and Enrollment entities. In fact both paragraphs contain the sentence: &quot;An Enrollment entity is associated with one Student entity...&quot;. But only the first occur should be right.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/pseudo70.jpg?forceidenticon=false&amp;dt=635048636400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>