<?xml version="1.0" encoding="UTF-8"?><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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:dtvmedia="http://participatoryculture.org/RSSModules/dtv/1.0"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>J Mathews &#187; Entity Framework</title>
	<atom:link href="http://www.justinemathews.com/tag/entity-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.justinemathews.com</link>
	<description>expertise in .Net technologies</description>
	<lastBuildDate>Tue, 17 Feb 2015 19:31:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1</generator>
	<!-- podcast_generator="podPress/8.5" -->
		<copyright>&#xA9; </copyright>
		<managingEditor>justinemathews@gmail.com ()</managingEditor>
		<webMaster>justinemathews@gmail.com</webMaster>
		<category></category>
		<itunes:keywords></itunes:keywords>
		<itunes:subtitle></itunes:subtitle>
		<itunes:summary>expertise in .Net technologies</itunes:summary>
		<itunes:author></itunes:author>
		<itunes:category text="Society &amp; Culture"/>
		<itunes:owner>
			<itunes:name></itunes:name>
			<itunes:email>justinemathews@gmail.com</itunes:email>
		</itunes:owner>
		<itunes:block>No</itunes:block>
		<itunes:explicit>no</itunes:explicit>
		<itunes:image href="http://www.justinemathews.com/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<image>
			<url>http://www.justinemathews.com/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
			<title>J Mathews</title>
			<link>http://www.justinemathews.com</link>
			<width>144</width>
			<height>144</height>
		</image>
	<item>
		<title>ASP.Net MVC with Entity Framework and Repository Pattern</title>
		<link>http://www.justinemathews.com/2009/11/asp-net-mvc-with-entity-framework-and-repository-pattern/</link>
		<comments>http://www.justinemathews.com/2009/11/asp-net-mvc-with-entity-framework-and-repository-pattern/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 17:06:15 +0000</pubDate>
		<dc:creator><![CDATA[J Mathews,MCSD.Net]]></dc:creator>
				<category><![CDATA[MVC]]></category>
		<category><![CDATA[ASP.Net MVC]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[Entity Framework with Repository]]></category>

		<guid isPermaLink="false">http://www.justinemathews.com/?p=53</guid>
		<description><![CDATA[<p>Repository pattern provides more object oriented way of encapsulating objects of the data store and operations can performed through neatly separated data classes. Please find below how Repository pattern implemented with entity framework and is consumed using asp.net mvc. Use either StructureMap or Ninject for dependency injection of the Entity Repository Factory object to the...
<p><a class="read-more" href="http://www.justinemathews.com/2009/11/asp-net-mvc-with-entity-framework-and-repository-pattern/">Read More &#8594;</a></p>
<p>The post <a rel="nofollow" href="http://www.justinemathews.com/2009/11/asp-net-mvc-with-entity-framework-and-repository-pattern/">ASP.Net MVC with Entity Framework and Repository Pattern</a> appeared first on <a rel="nofollow" href="http://www.justinemathews.com">J Mathews</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Repository pattern provides more object oriented way of encapsulating objects of the data store and operations can performed through neatly separated data classes. Please find below how Repository pattern implemented with entity framework and is consumed using asp.net mvc. Use either StructureMap or Ninject for dependency injection of the Entity Repository Factory object to the Controller classes.</p>
<p>Let us look at the Solution Structure first,</p>
<p><a href="http://www.justinemathews.com/wp-content/uploads/2009/11/clip_image0021.jpg" target="_blank"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 30px; border-right-width: 0px" height="553" alt="clip_image002" src="http://www.justinemathews.com/wp-content/uploads/2009/11/clip_image002_thumb1.jpg" width="306" border="0" /></a></p>
<p>Inside the Models, there is two folders DataInterfaces and Data. DataInterfaces folder contains Repository Interfaces and Data folder contains the Operating classes.Created NorthwindEntities using entity framework with Northwind Database. </p>
<h4>Class Diagram of Repository</h4>
<p><a href="http://www.justinemathews.com/wp-content/uploads/2009/11/clip_image0041.jpg" target="_blank"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 30px; border-right-width: 0px" height="244" alt="clip_image004" src="http://www.justinemathews.com/wp-content/uploads/2009/11/clip_image004_thumb1.jpg" width="555" border="0" /></a></p>
<h4>IBaseRepository</h4>
<p>Defines the interfaces that has the generic functionalities, which is need to be implemented in all repositories.</p>
<p><a href="http://www.justinemathews.com/wp-content/uploads/2009/11/image2.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 30px; border-right-width: 0px" height="291" alt="image" src="http://www.justinemathews.com/wp-content/uploads/2009/11/image_thumb2.png" width="549" border="0" /></a></p>
<h4>IRepositoryFactory</h4>
<p>Factory interface for the repositories, defines the interfaces to access the data objects, in this case customer object.</p>
<p><a href="http://www.justinemathews.com/wp-content/uploads/2009/11/clip_image0081.jpg" target="_blank"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 30px; border-right-width: 0px" height="193" alt="clip_image008" src="http://www.justinemathews.com/wp-content/uploads/2009/11/clip_image008_thumb1.jpg" width="628" border="0" /></a></p>
<h4>ICustomerRepository</h4>
<p>Entity specific repository, this is how the behavior of the object can be extended and can implement specific methods for the particular object.</p>
<p><a href="http://www.justinemathews.com/wp-content/uploads/2009/11/clip_image0101.jpg" target="_blank"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 20px; border-right-width: 0px" height="199" alt="clip_image010" hspace="12" src="http://www.justinemathews.com/wp-content/uploads/2009/11/clip_image010_thumb1.jpg" width="628" border="0" /></a></p>
<h4>AbstractEntityRepository</h4>
<p>This abstract class implements the Base interface method for all repositories.</p>
<p><a href="http://www.justinemathews.com/wp-content/uploads/2009/11/clip_image0121.jpg" target="_blank"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 30px; border-right-width: 0px" height="425" alt="clip_image012" src="http://www.justinemathews.com/wp-content/uploads/2009/11/clip_image012_thumb1.jpg" width="628" border="0" /></a></p>
<h4>EntityRepositoryFactory</h4>
<p>Entity repository Factory class, through the data objects are exposed.</p>
<p><a href="http://www.justinemathews.com/wp-content/uploads/2009/11/clip_image0141.jpg" target="_blank"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 30px; border-right-width: 0px" height="279" alt="clip_image014" src="http://www.justinemathews.com/wp-content/uploads/2009/11/clip_image014_thumb1.jpg" width="628" border="0" /></a></p>
<h4>CustomerRepository</h4>
<p>Data object classes implements the object repository, in this case ICustomerRepository.</p>
<p><a href="http://www.justinemathews.com/wp-content/uploads/2009/11/clip_image0161.jpg" target="_blank"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 30px; border-right-width: 0px" height="288" alt="clip_image016" src="http://www.justinemathews.com/wp-content/uploads/2009/11/clip_image016_thumb1.jpg" width="628" border="0" /></a></p>
<h4>EntityManager</h4>
<p>Provides the shared instance of the Entity Framework.Implemented using singleton pattern with nested class. </p>
<p><a href="http://www.justinemathews.com/wp-content/uploads/2009/11/image3.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 30px; border-right-width: 0px" height="441" alt="image" src="http://www.justinemathews.com/wp-content/uploads/2009/11/image_thumb3.png" width="608" border="0" /></a></p>
<h4>CustomerController</h4>
<p>Before the controller implementation, run the test through the CustomercontrollerTest class.</p>
<p>Please see below, how this is implemented in the controller class. Using either StructureMap or Ninject for dependency injection of the Entity Repository Factory object to the Controller class.And refer the related entity i.e. Customer Entity in this case using GetCustomerEntity() and call required method. </p>
<p><a href="http://www.justinemathews.com/wp-content/uploads/2010/01/image.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 30px; border-right-width: 0px" height="231" alt="image" src="http://www.justinemathews.com/wp-content/uploads/2010/01/image_thumb.png" width="630" border="0" /></a> </p>
<p>This completes implementation of sample method, Now ready to run the application. See the results below. Improved the look and feel using design template from <a href="http://www.ASP.net/mvc/gallery"><u>http://www.ASP.net/mvc/gallery</u></a>.</p>
<p><a href="http://www.justinemathews.com/wp-content/uploads/2009/11/image4.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 30px; border-right-width: 0px" height="417" alt="image" src="http://www.justinemathews.com/wp-content/uploads/2009/11/image_thumb4.png" width="644" border="0" /></a></p>
<p>&#160;<a href="http://www.justinemathews.com/wp-content/uploads/2009/11/image5.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 30px; border-right-width: 0px" height="484" alt="image" src="http://www.justinemathews.com/wp-content/uploads/2009/11/image_thumb5.png" width="481" border="0" /></a></p>
<p>The post <a rel="nofollow" href="http://www.justinemathews.com/2009/11/asp-net-mvc-with-entity-framework-and-repository-pattern/">ASP.Net MVC with Entity Framework and Repository Pattern</a> appeared first on <a rel="nofollow" href="http://www.justinemathews.com">J Mathews</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinemathews.com/2009/11/asp-net-mvc-with-entity-framework-and-repository-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
