<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>Implementing the Repository and Unit of Work Patterns in an ASP.NET MVC Application (9 of 10)</title><link>http://www.asp.net</link><pubDate>Mon, 17 Oct 2011 08:10:58 GMT</pubDate><generator>umbraco</generator><description>Comments for Implementing the Repository and Unit of Work Patterns in an ASP.NET MVC Application (9 of 10)</description><language>en</language><atom:link href="http://www.asp.net/rss/comments/33316" rel="self" type="application/rss+xml" /><item><title>Comment Posted by desmondcpx</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Fri, 15 Apr 2011 06:40:18 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012824</guid><description><![CDATA[ <p>Hello,</p><p>This tutorial made use of the IDisposable interface for the UnitofWork class and an overrided dispose method in the controller.</p><p></p><p>However many other tutorials do not do this. May I ask why and if it is necessary to implement the IDisposable interface.</p><p></p><p>Thank you very much</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/desmondcpx.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Sat, 16 Apr 2011 16:51:49 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012841</guid><description><![CDATA[ <p>Good question. For an explanation of why this is necessary, see the answers by Paul Linton in this forum thread:</p><p><a rel="nofollow" href="http://forums.asp.net/t/1664937.aspx/1?using+statement+on+linq+and+entity+framework" target="_blank">forums.asp.net/</a></p><p>This StackOverflow thread also has some useful information:<a rel="nofollow" href="http://stackoverflow.com/questions/1401327/entity-framework-how-should-i-instance-my-entities-object" target="_blank">stackoverflow.com/</a></p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by abussie22</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Mon, 18 Apr 2011 20:13:18 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012860</guid><description><![CDATA[ <p>Good tutorial. Any references on how to create interface for the Unit of work?</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/abussie22.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Wed, 20 Apr 2011 19:51:15 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012895</guid><description><![CDATA[ <p>Here is what the UnitOfWork interface would look like, the class implementing the interface, and the controller code using the interface:</p><p></p><p>Unit of work interface:</p><p></p><p>using ContosoUniversity.Models;</p><p>namespace ContosoUniversity.DAL</p><p>{</p><p>    public interface IUnitOfWork</p><p>    {</p><p>        void Save();</p><p>        IStudentRepository StudentRepository { get; }</p><p>    }</p><p>}</p><p></p><p></p><p>Unit of work implementing interface:</p><p></p><p>using ContosoUniversity.Models;</p><p>namespace ContosoUniversity.DAL</p><p>{</p><p>    public class UnitOfWork : IUnitOfWork</p><p>    {</p><p>        private SchoolEntities context = new SchoolEntities();</p><p>        private IStudentRepository studentRepository;</p><p></p><p>        public IStudentRepository StudentRepository</p><p>        {</p><p>            get</p><p>            {</p><p></p><p>                if (this.studentRepository == null)</p><p>                {</p><p>                    this.studentRepository = new StudentRepository(context);</p><p>                }</p><p>                return studentRepository;</p><p>            }</p><p>        }</p><p></p><p>        public void Save()</p><p>        {</p><p>            context.SaveChanges();</p><p>        }</p><p>    }</p><p>}</p><p></p><p>Controller class variable and constructors - default constructor creating UofW and non-default allowing it to be passed in:</p><p></p><p></p><p>        private IUnitOfWork unitOfWork;</p><p>        public StudentController () : this (new UnitOfWork())</p><p>        {</p><p>        }</p><p>        public StudentController (IUnitOfWork unitOfWork)</p><p>        {</p><p>            this.unitOfWork = unitOfWork;</p><p>        }</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by nalidixic</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Wed, 20 Apr 2011 23:30:10 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012898</guid><description><![CDATA[ <p>@tdykstra: With your your example above showing the UofW interface would the best thing to do in order to inject an IStudentRepository simply be to open a set on the inline property of the repository? </p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/nalidixic.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Thu, 21 Apr 2011 14:17:34 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012921</guid><description><![CDATA[ <p>@nalidixic</p><p>You could do that but the way I would do it is make the mock unit of work class inject mock repositories the same way this unit of work class injects the EF repositories.  </p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tobias123</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Tue, 03 May 2011 12:00:41 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013058</guid><description><![CDATA[ <p>hi,</p><p>why does the get method:</p><p></p><p>public virtual IEnumerable&lt;TEntity&gt; Get(</p><p>            Expression&lt;Func&lt;TEntity, bool&gt;&gt; filter = null,</p><p>            Func&lt;IQueryable&lt;TEntity&gt;, IOrderedQueryable&lt;TEntity&gt;&gt; orderBy = null,</p><p>            string includeProperties = &quot;&quot;)</p><p>        {</p><p>            IQueryable&lt;TEntity&gt; query = dbSet;</p><p></p><p>            if (filter != null)</p><p>            {</p><p>                query = query.Where(filter);</p><p>            }</p><p></p><p>            foreach (var includeProperty in includeProperties.Split</p><p>                (new char[] { &#39;,&#39; }, StringSplitOptions.RemoveEmptyEntries))</p><p>            {</p><p>                query = query.Include(includeProperty);</p><p>            }</p><p></p><p>            if (orderBy != null)</p><p>            {</p><p>                return orderBy(query).ToList();</p><p>            }</p><p>            else</p><p>            {</p><p>                return query.ToList();</p><p>            }</p><p>        }</p><p></p><p>accepts a Expression&lt;Func&lt;...&gt;&gt; for filter and &quot;only&quot; a Func&lt;...&gt; for orderBy Parameter? Wouldn&#39;t be a Func&lt;...&gt; for filter ok, too? (If yes, what would be the difference? Memory vs DB-execution?)</p><p></p><p>I understand that you can filter/order or better say &quot;narrow down&quot; the implementation with these parameters to get only the specific result you are looking for by the calling method. I am aware that Func&lt;..&gt; is basically just a delegate. However I have never really understood the difference to Expression&lt;...&gt;. Can somebody please clear this up on this example/method?</p><p></p><p>thanks!</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/tobias123.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Wed, 04 May 2011 22:52:06 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013072</guid><description><![CDATA[ <p>The difference is in how the parameters are used.  The Expression object represents a lambda expression that is passed in as a parameter to the Where clause on an IQueryable, while the orderBy parameter is actually used as a function in order to transform an IQueryable into an IOrderedQueryable.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Nimay11</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Tue, 10 May 2011 05:17:17 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013119</guid><description><![CDATA[ <p>Excellent post and this is what I was looking for. Plain simple working example</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/Nimay11.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by abussie22</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Thu, 19 May 2011 10:53:47 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013216</guid><description><![CDATA[ <p>Please provide an example of how to provide mock Unit of Work for testing. btw Love this post.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/abussie22.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by abussie22</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Thu, 19 May 2011 14:10:51 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013223</guid><description><![CDATA[ <p>How to organize EF Code 1st project by splitting logical pieces? Where to put Context Class? I have a class library for my domain which contains POCO classes, interfaces, and concrete implementations. Another Project for MVC WebUI and another project for Unit Test. Where will the Context go?</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/abussie22.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Sun, 22 May 2011 11:24:38 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013245</guid><description><![CDATA[ <p>@abussie22 - If you use the UoW with an interface as shown in my earlier comment, you can pass a mock UofW to it in a test class the same you would do with a repository if you were only using a repository. The second Web Forms series has an example that shows how to do this; although it&#39;s Web Forms and not MVC, the principal is the same.</p><p>For your second question, different people have different preferences for the best way to organize classes/layers into separate projects. StackOverflow is a great place to pose questions like that and get a lot of thoughtful answers from experienced developers.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by skotl</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Thu, 26 May 2011 10:01:16 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013278</guid><description><![CDATA[ <p>Excellent, clear and complete description. Thanks very much!</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/skotl.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by s_golovko</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Fri, 01 Jul 2011 08:03:28 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013655</guid><description><![CDATA[ <p>Where in the StudentController I have to call studentRepository.Dispose()?</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/s_golovko.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Mon, 04 Jul 2011 14:52:02 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013687</guid><description><![CDATA[ <p>@ s_golovko - If you look in the code snippet in the tutorial, you&#39;ll see that done in the override of the Dispose method.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by asifashraf</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Thu, 07 Jul 2011 03:47:48 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013710</guid><description><![CDATA[ <p>5 out of 5 to Generic repository concept...</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/asifashraf.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by gblossom</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Tue, 12 Jul 2011 16:33:03 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013750</guid><description><![CDATA[ <p>Being a very experienced hand at object oriented programming but new to C# and .Net, I found this a very good tutorial of a confusing (to me) topic but found one thing added to my confusion. You very consistently refer to certain variables as &quot;class&quot; variables when they are definitely NOT &quot;static&quot;. The most obvious of these is CourseController unitOfWork. It is also true of all of the variables in the UnitOfWork.cs example. Sorry to be so picky but I am trying hard to learn this concept.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/gblossom.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Thu, 14 Jul 2011 19:54:45 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013765</guid><description><![CDATA[ <p>@gblossom - &quot;class&quot; in this context refers to the scope of the variable and does not imply it is a static variable. For a discussion of scope in C# see  <a rel="nofollow" href="http://msdn.microsoft.com/en-us/library/ms973875.aspx" target="_blank">msdn.microsoft.com/</a>  (the article is old, but this aspect of the language hasn&#39;t changed).</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by PHILMEE95</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Thu, 01 Sep 2011 19:26:54 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014107</guid><description><![CDATA[ <p>Awesome tutorial. I am trying to consolidate one of my projects using Linq, Subsonic and some Ado.net and may finally be able to do so.</p><p></p><p>I can&#39;t seem to figure out how to build the &quot;query&quot; filter outside of the lambda expression or predicate or whatever the &quot;Get&quot; method has in   public virtual IEnumerable&lt;TEntity&gt; Get( </p><p>            Expression&lt;Func&lt;TEntity, bool&gt;&gt; filter = null, </p><p>            Func&lt;IQueryable&lt;TEntity&gt;, IOrderedQueryable&lt;TEntity&gt;&gt; orderBy = null, </p><p>            string includeProperties = &quot;&quot;) </p><p></p><p>outside of doing it inline. I build a query based on user input for large search forms based on inputs for a results page. I built a GetNonQuery function for the Generic repo that will give me a count of records meeting the same criteria (expression) of the Get Query, but can&#39;t build the get query.</p><p></p><p>The GetAggregate function is as follows for those trying to build a search results page from this sample app.</p><p>public virtual object GetAggregate (</p><p>           Expression&lt;Func&lt;TEntity, bool&gt;&gt; filter = null,</p><p>           Func&lt;IQueryable&lt;TEntity&gt;, object&gt; aggregate = null)</p><p>        {</p><p>            IQueryable&lt;TEntity&gt; query = dbSet;</p><p></p><p>            if (filter != null)</p><p>            {</p><p>                query = query.Where(filter);</p><p>            }</p><p></p><p>            if (aggregate != null)</p><p>            {</p><p>                return aggregate( query);</p><p>            }</p><p>            else</p><p>            {</p><p>                return null;</p><p>            }</p><p>        }</p><p></p><p>example of my query builing usage would be like dynamic link:</p><p>IQueryable&lt;whatever&gt; query = null;</p><p>if ( name != null) </p><p> query = query.Where( x=&gt;x.name == name)</p><p>if ( age &gt; 120)</p><p> query = query.Where( x=&gt;x.age == &quot;really old&quot;)</p><p>List&lt;x&gt; myList = query.ToList() (take, skip etc)</p><p></p><p>above GetAggregate function does the query.Count(). </p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/PHILMEE95.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Thu, 08 Sep 2011 17:59:54 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014161</guid><description><![CDATA[ <p>@PHILMEE95 - This sounds a little beyond the scope of the tutorial as it stands, and I dont&#39; have a ready answer for you. I expect you would get some good suggestions very quickly if you post it to StackOverflow. If you do that and have time to post the link here, I expect it would be useful to others, and I may be able to incorporate something similar into a future release of the tutorial.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by krzysiek89barca</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Fri, 23 Sep 2011 13:33:55 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014252</guid><description><![CDATA[ <p>Great and really real-world article, which can show new glimpse on design DAL.</p><p>I&#39;m sure I use unit of work by my new project.</p><p></p><p>Thanks</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/krzysiek89barca.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by TheGDizzo</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Mon, 26 Sep 2011 13:42:39 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014274</guid><description><![CDATA[ <p>There&#39;s a small error in the code provided for StudentController.cs</p><p></p><p>            int pageIndex = (page ?? 1) - 1; </p><p>            return View(students.ToPagedList(pageIndex, pageSize)); </p><p></p><p>The value of pageIndex upon intial execution equals 0 and apparently the .ToPagedList( ) method will only allow 1 as the smallest value.  Perhaps the .ToPagedList( ) method got changed internally at some point in time after this tutorial code was made?</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/TheGDizzo.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tdykstra</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Thu, 06 Oct 2011 14:47:43 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014344</guid><description><![CDATA[ <p>@TheGDizzo - Yes, the latest version of the PagedList NuGet package has a breaking change compared to the version the tutorial was written with.  This will be corrected in the next release of the tutorial, and the comments in tutorial #3 have more info about it.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/tdykstra.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by vest</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Fri, 07 Oct 2011 08:22:54 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014353</guid><description><![CDATA[ <p>Hello,</p><p></p><p>Why do we need to dispose an object context? If SchoolContext is derived from DataContext, it should already implement the IDisposable interface?</p><p></p><p>Thanks</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/vest.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by geomar</title><link>http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</link><pubDate>Mon, 17 Oct 2011 08:10:58 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014436</guid><description><![CDATA[ <p>The UnitOfWork.Dispose gets called from the Controller.  However, the Dispose is called on the context within the UnitOfWork.  This context has also been passed by reference to GenericRepository and CourseRepository.  Will the Repository references be disposed when UnitOfWork.Dispose is called?</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/geomar.jpg?forceidenticon=false&amp;dt=635046533400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>