<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
    <channel>
        <title>Andrew Siemer's Blog</title>
        <link>http://geekswithblogs.net/AndrewSiemer/Default.aspx</link>
        <description>Enterprise Web Applications, ASP.NET, C#, SQL Server, Architecture, &amp; Writing</description>
        <language>en-US</language>
        <copyright>Andrew Siemer - www.andrewsiemer.com</copyright>
        <managingEditor>asiemer@hotmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Andrew Siemer's Blog</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/AndrewSiemer/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/AndrewSiemer" type="application/rss+xml" /><item>
            <title>Review: ASP.NET MVC in Action by Jeffrey Palermo, Ben Scheirman, and Jimmy Bogard</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/mOYkVL9ATJg/review-asp.net-mvc-in-action-by-jeffrey-palermo-ben-scheirman.aspx</link>
            <description>&lt;p&gt;The &lt;a href="http://www.asp.net/mvc/"&gt;ASP.NET MVC&lt;/a&gt; framework was just released as a preview when I started to write my first book (&lt;a href="http://www.amazon.com/ASP-NET-3-5-Social-Networking-Enterprise-ready/dp/1847194788/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1225408005&amp;amp;sr=8-1"&gt;ASP.NET 3.5 Social Networking&lt;/a&gt;).  In the early days of design decisions for my book I was faced with the problem of building with the MVP pattern or the new &lt;a href="http://www.asp.net/mvc/"&gt;MVC&lt;/a&gt; pattern/framework.  At that time there was next to nothing regarding the use of (proper or improper) the ASP.NET MVC framework.  &lt;/p&gt;  &lt;p&gt;Shortly after I got started with my project (which I chose to do in MVP) I was asked to do a review for the &lt;a href="http://www.amazon.com/ASP-NET-MVC-Action-Jeffrey-Palermo/dp/1933988622/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1245789868&amp;amp;sr=1-1"&gt;ASP.NET MVC in Action&lt;/a&gt; book.  I gladly accepted and started to read as Jeffrey Palermo, Ben Scheirman, and Jimmy Bogard explored the world of the ASP.NET MVC offerings.  I thought that they did a very good job of describing how Microsoft meant you to use the new framework and a better job of describing how to break beyond the limitations of the current offerings.  &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.amazon.com/gp/product/images/1933988622/sr=1-1/qid=1245789868/ref=dp_image_0?ie=UTF8&amp;amp;n=283155&amp;amp;s=books&amp;amp;qid=1245789868&amp;amp;sr=1-1"&gt;&lt;img height="240" alt="ASP.NET MVC in Action" src="http://ecx.images-amazon.com/images/I/51Apmme8IUL._SL500_AA240_.jpg" width="240" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I must say that this is one of the few books that I have ever read cover to cover so many times!  With each review of the book I went through each chapter to find any updates.  As this book was being written several new CTP’s of the ASP.NET MVC framework were released.  With each of the CTP releases came a new rendering of the book.  It was quite fun to see how quickly things changed of the year that this book was written in.&lt;/p&gt;  &lt;p&gt;Finally having the final review in my hands and being so very familiar with it’s content, I have to say that of all the books on the ASP.NET MVC framework the ASP.NET MVC in Action book should be at the top of your list for things to purchase in the upcoming months.  At a quick glance this book covers all things relating to ASP.NET MVC and then some.  This book is not just a regurgitation of MSDN or other resource as so many books are these days.  Here are the chapter titles for this book:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Getting started with the ASP.NET MVC Framework &lt;/li&gt;    &lt;li&gt;The Model in depth &lt;/li&gt;    &lt;li&gt;The Controller in depth &lt;/li&gt;    &lt;li&gt;Views in depth &lt;/li&gt;    &lt;li&gt;Routing &lt;/li&gt;    &lt;li&gt;Customizing and extending the ASP.NET MVC Framework &lt;/li&gt;    &lt;li&gt;Scaling the architecture to more complex sites &lt;/li&gt;    &lt;li&gt;Leveraging existing ASP.NET features &lt;/li&gt;    &lt;li&gt;AJAX in ASP.NET MVC (which includes coverage of jQuery!) &lt;/li&gt;    &lt;li&gt;Hosting and Deployment &lt;/li&gt;    &lt;li&gt;Exploring MonoRail and Ruby on Rails &lt;/li&gt;    &lt;li&gt;Best Practices &lt;/li&gt;    &lt;li&gt;Recipes &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;As you can clearly see from the above this is more than just the XYZ of ASP.NET MVC.  I highly recommend this book for anyone interested in breaking away from the pains of ASP.NET WebForms.  This framework, especially with the help of this new book, makes programming for the web fun again!&lt;/p&gt;  &lt;p&gt; &lt;/p&gt; &lt;b&gt;Andrew Siemer&lt;/b&gt;   &lt;br /&gt;Teacher, Author, Engineer, Architect, Build Master, Scrum Master, Father of 6, Husband, ex Army Ranger   &lt;br /&gt;  &lt;br /&gt;&lt;b&gt;My Book&lt;/b&gt;   &lt;br /&gt;  &lt;div style="width: 300px"&gt;&lt;a href="http://www.amazon.com/ASP-NET-3-5-Social-Networking-Enterprise-ready/dp/1847194788/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1228158561&amp;amp;sr=1-1"&gt;&lt;img style="float: left" src="http://ecx.images-amazon.com/images/I/41Bw%2BOVfX9L._SL160_AA115_.jpg" border="0" /&gt;ASP.NET 3.5 Social Networking: An Expert Guide to Building Enterprise-ready Social Networking and Community Applications with ASP.NET 3.5&lt;/a&gt;&lt;/div&gt;  &lt;br /&gt;  &lt;br /&gt;&lt;b&gt;Links&lt;/b&gt;   &lt;br /&gt;  &lt;div style="display: block"&gt;&lt;a href="http://blog.andrewsiemer.com"&gt;Blog.AndrewSiemer.com&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.andrewsiemer.com"&gt;AndrewSiemer.com&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.pictfresh.com"&gt;PictFresh.com&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.linkedin.com/in/andrewsiemer"&gt;Linked In&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.myspace.com/andrewsiemer"&gt;My Space&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.facebook.com/home.php?#/profile.php?id=768368610&amp;amp;hiq=andrew%2Csiemer"&gt;Face Book&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://twitter.com/asiemer"&gt;Twitter&lt;/a&gt; &lt;a href="http://andrewsiemer.gymed.com"&gt;AndrewSiemer.GymEd.com&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.gymed.com"&gt;GymEd.com&lt;/a&gt;     &lt;br /&gt;&lt;iframe marginwidth="0" marginheight="0" src="http://stackoverflow.com/users/flair/83889.html" frameborder="0" width="210" scrolling="no" height="60"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133019"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133019" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/133019.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2009/06/23/review-asp.net-mvc-in-action-by-jeffrey-palermo-ben-scheirman.aspx</guid>
            <pubDate>Tue, 23 Jun 2009 20:41:31 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/133019.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2009/06/23/review-asp.net-mvc-in-action-by-jeffrey-palermo-ben-scheirman.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/133019.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/133019.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2009/06/23/review-asp.net-mvc-in-action-by-jeffrey-palermo-ben-scheirman.aspx</feedburner:origLink></item>
        <item>
            <title>NDepend review &amp;ndash; code evolution achieved by following NDepend metrics</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/39mVzs34spQ/ndepend-review-ndash-code-evolution-achieved-by-following-ndepend-metrics.aspx</link>
            <description>&lt;p&gt;The people behind the &lt;a href="http://www.ndepend.com/"&gt;NDepend&lt;/a&gt; software recently provided me with their latest version of NDepend to see what I thought.  I initially ran the package over one of my recent projects and found that &lt;a href="http://blog.socialnetworkingin.net/archive/2009/05/19/ndepend-report-for-fisharoo-code-base.aspx"&gt;the reporting&lt;/a&gt; offered in the latest version of NDepend was infinitely better than the previous version (1.0) that I worked with.  I found the reports that NDepend was offering would be most valuable while building my latest project.  For this reason I started my latest project in a manner that would leave much room for improvement.  &lt;/p&gt;  &lt;h3&gt;My application in the beginning&lt;/h3&gt;  &lt;p&gt;The project that I am going to run NDepend over to help me catch mistakes as I develop is built in ASP.NET MVC, LINQ to SQL, and following Domain Driven Design.  I specifically didn’t follow most of the &lt;a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod"&gt;SOLID principles&lt;/a&gt; to see how well NDepend would allow me to catch and correct my deficiencies.  To start off I am using the standard Model View Controller concepts and have stuffed all of my business and data access layer into a separate assembly project.  I am building a services layer, have specific domain objects (generated by LINQ to SQL), and am using the Repository pattern.  Beyond that I am new’ing up class references, not creating interfaces for anything, and am lumping generic concepts into generic classes.&lt;/p&gt;  &lt;p&gt;With that in mind I ran NDepend over my initial code base and was given the following reports (there is a lot more information offered…but we will start here):&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="392" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_3.png" width="327" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="288" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_6.png" width="463" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/VisualNDependView_2.png"&gt;&lt;img title="VisualNDependView" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="500" alt="VisualNDependView" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/VisualNDependView_thumb.png" width="500" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/AbstractnessVSInstability_2.png"&gt;&lt;img title="AbstractnessVSInstability" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="500" alt="AbstractnessVSInstability" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/AbstractnessVSInstability_thumb.png" width="500" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/ComponentDependenciesDiagram_2.png"&gt;&lt;img title="ComponentDependenciesDiagram" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="238" alt="ComponentDependenciesDiagram" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/ComponentDependenciesDiagram_thumb.png" width="500" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="426" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_9.png" width="747" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;What does all of this mean?  I took a look at this cheat sheet (&lt;a title="http://www.hanselman.com/blog/content/binary/NDepend%20metrics%20placemats%201.1.pdf" href="http://www.hanselman.com/blog/content/binary/NDepend%20metrics%20placemats%201.1.pdf"&gt;http://www.hanselman.com/blog/content/binary/NDepend%20metrics%20placemats%201.1.pdf&lt;/a&gt;) to begin to decipher all of this information.  On our abstractness and instability chart my code is currently showing as being very concrete and very stable!  This is not a bad zone to be in (my code is neither painful or useless).  &amp;lt;GRIN&amp;gt;  Also, when looking at my dependency graph you will notice that for the most part (MOST PART) my presentation layer is only communicating with the sub system through my business layer.  Some of my code is generated (LINQ to SQL) or part of a framework (&lt;a href="http://www.asp.net/mvc/"&gt;ASP.NET MVC&lt;/a&gt;) which means that there is not a whole lot I can do in some regards.  And we can clearly see in the metrics section (all the gradient squares) that some areas have a lot more code dedicated to them than others.  Finally we have a list of high level warnings (yellow sections of the CQL) that may benefit from closer inspection.&lt;/p&gt;  &lt;p&gt;Since I have a nice baseline of my application built in a standard tiered manner but not following my normal development avenues (&lt;a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod"&gt;SOLID&lt;/a&gt;), I am going to first avoid the direct output of these reports and add in a couple of my normal design decisions to see how it affects these reports.  I am first most curious to see how implementing &lt;a href="http://structuremap.sourceforge.net/Default.htm"&gt;StructureMap&lt;/a&gt; will help me here as it will force me to generate interfaces for all of my classes as well as remove all the static dependencies in my code.  Also, once I have &lt;a href="http://structuremap.sourceforge.net/Default.htm"&gt;StructureMap&lt;/a&gt; implemented it will be easier to do things like Inversion of Control and Test Driven Development. Implementing StructureMap will help us get closer to the concept of the &lt;a href="http://iface.wordpress.com/2006/03/28/interface-segregation-principle/"&gt;Interface Segregation Principle&lt;/a&gt;.  Once that is done I will rerun the reports to see where we are.  Then I will implement Inversion of Control (&lt;a href="http://en.wikipedia.org/wiki/Inversion_of_Control"&gt;IoC&lt;/a&gt;) to see how that impacts things.  My next step would be to refactor my code so that it follows the &lt;a href="http://en.wikipedia.org/wiki/Single_responsibility_principle"&gt;Single Responsibility Principle&lt;/a&gt; (but in the effort to get this post done…I may push that to another article!).&lt;/p&gt;  &lt;h3&gt;Application after StructureMap&lt;/h3&gt;  &lt;p&gt;Once I added &lt;a href="http://structuremap.sourceforge.net/Default.htm"&gt;StructureMap&lt;/a&gt; into my source code for all the references that I could I started to find myself moving up the scale of “uselessness” but no closer to “abstractness” (which makes sense).  The change that was made was that rather than saying Object o = new Object() I am now generating an interface (with &lt;a href="http://www.jetbrains.com/resharper/" target="_blank"&gt;ReSharper&lt;/a&gt;) for the Object and then declaring an instance of the object using StructureMap using syntax like IObject o = ObjectFactory.GetInstance&amp;lt;IObject&amp;gt;().  This basically means that pretty much everything has an interface defining it’s usage.  Also, with StructureMap I can swap in mocks when testing.  This makes my code much more flexible down the road (more flexible apparently equals more useless).  An example of this flexibility is that if I want to use the standard .NET Cache initially I can.  Then later I can swap in a new MemCache object simply by injecting the new object everywhere that ICache is called for via StructureMap.  This is done with a couple of lines of configuration code in the StructureMap.config file…lots of power here!&lt;/p&gt;  &lt;p&gt;Before (StructureMap and interfaces not used):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_47.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="536" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_thumb_14.png" width="536" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;After (StructureMap implemented where possible, interfaces used where appropriate):&lt;/p&gt;  &lt;p&gt; &lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_8.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="494" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_thumb.png" width="500" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Here are the other items to look at.&lt;/p&gt;  &lt;p&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="394" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_12.png" width="331" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="288" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_15.png" width="463" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_17.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="500" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_thumb_3.png" width="500" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_19.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="354" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_thumb_4.png" width="500" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="428" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_22.png" width="753" border="0" /&gt; &lt;/p&gt;  &lt;p&gt; Having done my best to start following the &lt;a href="http://iface.wordpress.com/2006/03/28/interface-segregation-principle/"&gt;Interface Segregation Principle&lt;/a&gt; I am now going to turn to my next favorite pattern/principal by implementing Inversion of Control (or the &lt;a href="http://en.wikipedia.org/wiki/Dependency_inversion_principle"&gt;Dependency Inversion Principle&lt;/a&gt;) and see what improvements that gives us.&lt;/p&gt;  &lt;h3&gt;My application with Inversion of Control&lt;/h3&gt;  &lt;p&gt;In order to apply inversion of control to my application I will be taking all of the instantiations out of my methods and moving them out to parameters of a method or passed in via the constructor.  Now that I have StructureMap sewn into the application I can take advantage of some of its power in that if it sees an interface being specified in the constructor of an object that it is instantiating, it will go ahead and pass in the appropriate instance of that required object.  &lt;/p&gt;  &lt;p&gt;For example, prior to doing IoC I had a &lt;a href="http://en.wikipedia.org/wiki/Domain-driven_design"&gt;repository&lt;/a&gt; class that would work with accounts (AccountRepository).  It would instantiate an instance of the Connection class internally and then do the work it needed to do to connect to the database and grab the appropriate account related data.  This means that the Connection class and the AccountRepository class were very strongly coupled to one another.  Some of this coupling in the same layer is not horrible…but in this case every single repository in my application would be coupled to my Connection object which over time would rapidly become a very large number.&lt;/p&gt;  &lt;p&gt;We can easily fix this scenario using StructureMap in that we can require IConnection be passed in via the constructor of each repository class.  Then when we instantiate a repository object StructureMap will take care of passing the appropriate Connection to the Repository and we are off and running.  This removes the need for users of the Repository to be aware of which Connection object to use and reduces coupling considerably.&lt;/p&gt;  &lt;p&gt;I will apply this concept to the entire application and see how that affects things in NDepend’s eyes.&lt;/p&gt;  &lt;p&gt;Argh!  There was no physical change to my NDepend reports simply by implementing IoC!  NDepend looks at coupling across assemblies but not inside the assembly (at least I don’t see that anywhere).  No worries!  This addition will help down the road when it is time to start implementing our unit tests.  Not a total loss.&lt;/p&gt;  &lt;h3&gt;Addressing the canned CQL Queries and Constraints&lt;/h3&gt;  &lt;p&gt;Ok, let’s dig into some of the CQL Queries and Constraints to see if we can affect change that way.  The yellow sections of this report are the areas that need attention.&lt;/p&gt;  &lt;p&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="429" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_25.png" width="751" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;Lets start off with the Encapsulation warnings (section in red above).  In the Visual NDepend interface I can see the following warnings.&lt;/p&gt;  &lt;p&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="293" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_28.png" width="503" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;By double clicking on the first item “Methods” I see the following list.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_30.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="130" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_thumb_8.png" width="622" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Here you see specific suggestions to make my code more compliant with rules of encapsulation!  Double clicking the first problem area “Methods that could be declared as…” I am presented with this list.&lt;/p&gt;  &lt;p&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="191" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_33.png" width="201" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;Double clicking on any of these method names takes me directly to the code (in Visual Studio) that needs help.  From there I can dig around to see about making the suggested changes.  In some cases I see where I could indeed mark something as “internal”…however the suggestions that are being made are simply because nothing external to the assembly is calling the specific method.  Unfortunately for me I frequently import libraries and tools from past projects knowing that I will need to use them eventually.  In my case most of the suggested items that need to be fixed are items that are waiting to be used rather than items that need to be marked as internal!  &lt;/p&gt;  &lt;p&gt;I continued to poke through their list of suggestions and found that while the suggestions are good, they are not always 100% appropriate.  This means that I will have to learn to live with some of these yellow cautionary sections as I can’t get them to go away (without mangling their CQL queries…which may apply at a later date)!&lt;/p&gt;  &lt;h3&gt;NDepend is super flexible!&lt;/h3&gt;  &lt;p&gt;Now that I have been using this product for a while, and have started to bump my head against it a bit, I am starting to find that this product is actually very flexible!  For example there is a query for for naming standards I have started to bump my head against.  I like to use an underscore to denote my private fields in a class.  NDepend would prefer that I use m_ instead.  To change this is quick and easy.  I simply locate the rule that bugs me, double click on it, make the change in the CQL query editor, and save the changes.&lt;/p&gt;  &lt;p&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="283" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_50.png" width="889" border="0" /&gt;  &lt;/p&gt;  &lt;p&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="274" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_53.png" width="701" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;I made the changes to the query above so that it now looks like this:&lt;/p&gt;  &lt;p&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="267" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/NDependcodeevolutionachievedbyfollowingN_C6E5/image_56.png" width="685" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;This goes for all of the rules that are in this product which means that I can add and remove rules as I see fit!&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132479"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132479" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/132479.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2009/05/28/ndepend-review-ndash-code-evolution-achieved-by-following-ndepend-metrics.aspx</guid>
            <pubDate>Thu, 28 May 2009 21:07:19 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/132479.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2009/05/28/ndepend-review-ndash-code-evolution-achieved-by-following-ndepend-metrics.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/132479.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/132479.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2009/05/28/ndepend-review-ndash-code-evolution-achieved-by-following-ndepend-metrics.aspx</feedburner:origLink></item>
        <item>
            <title>Social Networking in .NET</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/jiNxuL4r9bo/social-networking-in-.net.aspx</link>
            <description>&lt;p&gt;I finally posted the code from my book &lt;a href="http://www.amazon.com/ASP-NET-3-5-Social-Networking-Enterprise-ready/dp/1847194788/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1225408005&amp;amp;sr=8-1"&gt;ASP.NET 3.5 Social Networking&lt;/a&gt; on CodePlex at  &lt;a title="http://community.codeplex.com/" href="http://community.codeplex.com/"&gt;http://community.codeplex.com/&lt;/a&gt;.  Several people have asked for this so that we can make changes to the code and improve/expand the code base.  I think I may also take the time to convert it from the MVP pattern to the latest ASP.NET MVC pattern/template as well as add test coverage the project.  I also set up a forum for this at &lt;a href="http://forum.socialnetworkingin.net"&gt;forum.socialnetworkingin.net&lt;/a&gt; and a separate blog at &lt;a href="http://blog.socialnetworkinging.net"&gt;blog.socialnetworkinging.net&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132044"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132044" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/132044.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2009/05/11/social-networking-in-.net.aspx</guid>
            <pubDate>Mon, 11 May 2009 23:09:23 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/132044.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2009/05/11/social-networking-in-.net.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/132044.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/132044.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2009/05/11/social-networking-in-.net.aspx</feedburner:origLink></item>
        <item>
            <title>SOLID principles explained in a visual manner</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/TQdCQXbmL2k/solid-principles-explained-in-a-visual-manner.aspx</link>
            <description>&lt;p&gt;If you followed any of the banter regarding the SOLID principles between “uncle” Bob Martin and Joel Spolsky you may have also already seen the SOLID development principles in motivational pictures.  If not follow through all the links listed here.  The last one has the pictures.&lt;/p&gt;  &lt;p&gt;Simple podcast outlining the SOLID principles: &lt;a title="http://www.hanselminutes.com/default.aspx?showID=163" href="http://www.hanselminutes.com/default.aspx?showID=163"&gt;http://www.hanselminutes.com/default.aspx?showID=163&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Jeff Atwood, Joel Spolsky, and “uncle” Bob Martin discuss SOLID: &lt;a title="http://itc.conversationsnetwork.org/shows/detail4012.html" href="http://itc.conversationsnetwork.org/shows/detail4012.html"&gt;http://itc.conversationsnetwork.org/shows/detail4012.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Hanselman’s follow on interview with “uncle” Bob Martin: &lt;a title="http://www.hanselminutes.com/default.aspx?showID=168" href="http://www.hanselminutes.com/default.aspx?showID=168"&gt;http://www.hanselminutes.com/default.aspx?showID=168&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The best thing that came from all of this is the following pictures from LosTechies:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://www.lostechies.com/blogs/derickbailey/archive/2009/02/11/solid-development-principles-in-motivational-pictures.aspx"&gt;http://www.lostechies.com/blogs/derickbailey/archive/2009/02/11/solid-development-principles-in-motivational-pictures.aspx&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131893"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131893" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/131893.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2009/05/07/solid-principles-explained-in-a-visual-manner.aspx</guid>
            <pubDate>Fri, 08 May 2009 02:29:21 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/131893.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2009/05/07/solid-principles-explained-in-a-visual-manner.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/131893.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/131893.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2009/05/07/solid-principles-explained-in-a-visual-manner.aspx</feedburner:origLink></item>
        <item>
            <title>Huagati DBML/EDMX Tools</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/TCPPxtksGTE/huagati-dbmledmx-tools.aspx</link>
            <description>&lt;p&gt;Anyone that is working frequently with either LINQ to SQL or the Entity Framework needs to go get a copy of the Huagati DBML/EDMX tools.  They plug right into Visual Studio (2008) and allow you to perform many of the tasks that you would think VS would do for you.  I just recently had a new dev db get corrupted.  I had no backups for it.  I also had no scripts generated for it.  Argh!  What to do?  With this tool I was able to reverse engineer my EDMX file and spit out all the SQL I needed to generate the database.  There are many other features provided with this tool that I am sure you will love too.&lt;/p&gt;  &lt;p&gt;This tool is offered in a free 30 day trial.  Then there are a few paid versions.  I think that the professional version is worth the $120 price tag but there is a $50 version and a $12/mo subscription option.  Very good stuff!  Go grab a copy.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131392"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131392" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/131392.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2009/04/22/huagati-dbmledmx-tools.aspx</guid>
            <pubDate>Wed, 22 Apr 2009 19:52:37 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/131392.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2009/04/22/huagati-dbmledmx-tools.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/131392.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/131392.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2009/04/22/huagati-dbmledmx-tools.aspx</feedburner:origLink></item>
        <item>
            <title>Susan Boyle &amp;ndash; not geeky&amp;hellip;but WOW! Must watch.</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/uTijZUYhu6g/susan-boyle-ndash-not-geekyhellipbut-wow-must-watch.aspx</link>
            <description>&lt;div class="wlWriterEditableSmartContent" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:917a69ab-4065-4fd8-91b7-adb984909cd0" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;div id="96a63d09-94df-4272-901c-2d251eccc0e8" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=9lp0IWv8QZY" target="_new"&gt;&lt;img src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/SusanBoylenotgeekybutWOWMustwatch_B450/videoec2571e0a576.jpg" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('96a63d09-94df-4272-901c-2d251eccc0e8'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/9lp0IWv8QZY&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/9lp0IWv8QZY&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131247"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131247" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/131247.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2009/04/16/susan-boyle-ndash-not-geekyhellipbut-wow-must-watch.aspx</guid>
            <pubDate>Thu, 16 Apr 2009 17:49:24 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/131247.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2009/04/16/susan-boyle-ndash-not-geekyhellipbut-wow-must-watch.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/131247.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/131247.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2009/04/16/susan-boyle-ndash-not-geekyhellipbut-wow-must-watch.aspx</feedburner:origLink></item>
        <item>
            <title>Word Press Tag Cloud to be reused across other tag-able systems &amp;ndash; WP Cumulous</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/a8KTqAnN7CY/word-press-tag-cloud-to-be-reused-across-other-tag-able.aspx</link>
            <description>&lt;p&gt;I was scooting about the net the other day and landed on someone’s site that had the most fascinating tag cloud I have seen so far.  The tags in this cloud revolve as though they are in a 3d sphere.  When you mouse over the sphere you can move the words up down and around.  Very interesting.  This is a flash based control that you can feed with an XML file.  Also, the source for it is readily available which makes it a tool that can be ported to just about any tab based platform.  Very nice!  See the home page for this widget &lt;a href="http://www.roytanck.com/2008/03/15/wp-cumulus-released/"&gt;here&lt;/a&gt; or get the developer (source) version &lt;a href="http://downloads.wordpress.org/plugin/wp-cumulus.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/WordPressTagCloudtobereusedacrossotherta_9543/image_2.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="375" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/WordPressTagCloudtobereusedacrossotherta_9543/image_thumb.png" width="375" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130721"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130721" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/130721.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2009/04/03/word-press-tag-cloud-to-be-reused-across-other-tag-able.aspx</guid>
            <pubDate>Fri, 03 Apr 2009 15:36:53 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/130721.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2009/04/03/word-press-tag-cloud-to-be-reused-across-other-tag-able.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/130721.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/130721.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2009/04/03/word-press-tag-cloud-to-be-reused-across-other-tag-able.aspx</feedburner:origLink></item>
        <item>
            <title>ILOG Rules for .NET 3.0 &amp;ndash; quick overview</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/3wP6oRuO07E/ilog-rules-for-.net-3.0-ndash-quick-overview.aspx</link>
            <description>&lt;p&gt;I have been working on a project for the past year or so.  This project was originally decided to be implemented in a BizTalk environment.  Although most of us were new to this form of SOA development we went ahead with the understanding that we would eventually learn enough to stand up, manage, and develop for BizTalk.  With this in mind we developed our entire application in such a way that we thought the app would simply plug in to the BizTalk environment (from an orchestration point of view any ways).&lt;/p&gt;  &lt;p&gt;Some of the reasons that we decided to go with BizTalk was that it was very scalable, configurable, flexible, and that it had many components that we could easily use in our application.  Some of these components were the Business Rules Engine (BRE), various reporting tools (BAM), built in queue integration, etc.  We liked the idea of using already built and tested components.  Why recreate the wheel after all?  After we played with BizTalk for quite some time, took several classes, and spent many months with our BizTalk consultants, we eventually heard one statement that summed up BizTalk in every way:&lt;/p&gt;  &lt;p&gt;“BizTalk can do anything you want it too, it just can’t do anything out of the box!”&lt;/p&gt;  &lt;p&gt;Whaaaaa?&lt;/p&gt;  &lt;p&gt;Any ways…again…a year later I am still working on an application that needs some of these BizTalk style components.  One of which we have found is needed more and more.  We needed an external program to manage the flow of our application.  One might immediately jump to Windows Workflow Foundation and the Rules Engine that comes with WWF.  However, one of the marching orders of this application is that the business users can make changes to the logic of the application in such a way that it doesn’t require a code push and is not restricted by the length of a development cycle.  We had looked into several rules engines along the way to see if any were capable of addressing this need.  All of the rules engines that we came across were Java based and forced you to integrate with them via web services.  Yuck.  &lt;/p&gt;  &lt;p&gt;We eventually came across ILOG Rules for .NET.  This is a program (now owned by IBM and a Microsoft Gold partner) that integrates into a .NET developers world in a very seamless manner.  It plugs right into Visual Studio allowing the developer to define flows, express facts to rule editors, verbalize those facts in a more business friendly manner, and call into the execution server to run the rules all without any headache at all.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/ILOGRulesfor.NET3.0quickoverview_CE8D/image_2.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="562" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/ILOGRulesfor.NET3.0quickoverview_CE8D/image_thumb.png" width="604" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In addition to that the rules, decision tables, and flows can be edited externally in Microsoft Word or Excel.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/ILOGRulesfor.NET3.0quickoverview_CE8D/image_4.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="441" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/ILOGRulesfor.NET3.0quickoverview_CE8D/image_thumb_1.png" width="604" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/ILOGRulesfor.NET3.0quickoverview_CE8D/image_6.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="440" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/ILOGRulesfor.NET3.0quickoverview_CE8D/image_thumb_2.png" width="604" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And for those in a real Microsoft shop you probably have a SharePoint installation to manage all of your documents.  SharePoint is also fully integrated into this suite for rule doc management, workflow management, etc.  (sorry, no screen shot of this yet)&lt;/p&gt;  &lt;p&gt;The best part of this application in my mind is that ILOG gives you a 6 month free trial of the fully functional suite!  This means that you can easily knock together a proof of concept before you purchase their (very reasonably priced) program.  &lt;a title="http://www.ilog.com/dev/brms/rfdntrial/" href="http://www.ilog.com/dev/brms/rfdntrial/"&gt;http://www.ilog.com/dev/brms/rfdntrial/&lt;/a&gt;  And another benefit to their free trial is that they provide you will full access to their support forum.  I had a few issues during my POC development that I got pretty quick help with through this online help format!&lt;/p&gt;  &lt;p&gt;In future posts I will show my proof of concept and address some of the gotchas that I ran into.&lt;/p&gt;  &lt;p&gt;I am going to assume that you can get through their registration and free trial download process.  I am also going to assume that you can get all of their programs installed and running (they cover that pretty well).  &lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;u&gt;One word to the wise – do be sure to install the execution server first so that you don’t have to mess with any configuration files down the road!  This should be pretty easy as it is the first installer you come across.&lt;/u&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Also, be sure to read through their various documents and white papers (with the QuickStart being the most helpful!):&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="500" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="250"&gt;Quick Start&lt;/td&gt;        &lt;td valign="top" width="250"&gt;C:\Program Files\ILOG\ILOG Rules for .NET Quick Start 3.0\Documentation\QuickStart.pdf&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="250"&gt;White papers&lt;/td&gt;        &lt;td valign="top" width="250"&gt;&lt;a title="http://www.ilog.com/products/rulesnet/whitepapers/" href="http://www.ilog.com/products/rulesnet/whitepapers/"&gt;http://www.ilog.com/products/rulesnet/whitepapers/&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="250"&gt;Online help&lt;/td&gt;        &lt;td valign="top" width="250"&gt;&lt;a title="http://docs.ilog.com/brms/documentation/rulesnet30/" href="http://docs.ilog.com/brms/documentation/rulesnet30/"&gt;http://docs.ilog.com/brms/documentation/rulesnet30/&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130539"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130539" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/130539.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2009/03/30/ilog-rules-for-.net-3.0-ndash-quick-overview.aspx</guid>
            <pubDate>Mon, 30 Mar 2009 20:14:10 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/130539.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2009/03/30/ilog-rules-for-.net-3.0-ndash-quick-overview.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/130539.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/130539.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2009/03/30/ilog-rules-for-.net-3.0-ndash-quick-overview.aspx</feedburner:origLink></item>
        <item>
            <title>Entity Framework : An entity object cannot be referenced by multiple instances of IEntityChangeTracker.</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/WCp0biwhg34/entity-framework--an-entity-object-cannot-be-referenced-by.aspx</link>
            <description>&lt;p&gt;I just had this error where entity framework was complaining about my object already being referenced by the data context that I originally got the object from.  In LINQ to SQL I guess this was just taken care of for me.  I would get the object in a using statement so that the data context was cleared when I was through with the context.  Then I could do what ever I wanted to with the object after that – to include throwing it back to the database.&lt;/p&gt;  &lt;p&gt;I came across the fix to this issue here: &lt;a title="http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/501d7b99-0cb9-44b6-b2cd-16275a151b31" href="http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/501d7b99-0cb9-44b6-b2cd-16275a151b31"&gt;http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/501d7b99-0cb9-44b6-b2cd-16275a151b31&lt;/a&gt; which simply suggests detaching the object from the original context before I kill that context.  Then I can re-attach the object to a new context later on.  This solved the issue…but uncovered more issues.&lt;/p&gt;  &lt;p&gt;Here is my post to the MS forum:&lt;/p&gt;  &lt;p&gt;-----------------------------------------------------------------------------------&lt;/p&gt;  &lt;p&gt;Working in a web app I am very fond of the Repository approach.  I generally create a new context inside a using statement which then kills the context for me once my snippet of work is complete.  So for an AccountsRepository I might have a Save(Account account) method which would have something like the following:&lt;/p&gt;  &lt;p&gt;using (RanchBuddyDataContext dc = new Connection().GetContext()) &lt;/p&gt;  &lt;p&gt;                { &lt;/p&gt;  &lt;p&gt;                    if(account.AccountID &amp;gt; 0) &lt;/p&gt;  &lt;p&gt;                    { &lt;/p&gt;  &lt;p&gt;                        dc.Accounts.Attach(account, true); &lt;/p&gt;  &lt;p&gt;                    } &lt;/p&gt;  &lt;p&gt;                    else &lt;/p&gt;  &lt;p&gt;                    { &lt;/p&gt;  &lt;p&gt;                        dc.Accounts.InsertOnSubmit(account); &lt;/p&gt;  &lt;p&gt;                    } &lt;/p&gt;  &lt;p&gt;                    dc.SaveChanges(); &lt;/p&gt;  &lt;p&gt;                } &lt;/p&gt;  &lt;p&gt;While this worked great in LINQ to SQL I am finding that it doesn't work so well with the Entity Framework.  I am now getting the error that started this thread.  In order to address this problem I have to do a few things and am not liking the work that goes into this.  Hopefully someone can adjust my way of thinking on this.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;For my particular issue I have a person that logs into the system.  Once the log in is correct I stash their account object (fairly light) into their current session.  I then refer to that now and then as needed.  This works great.  However, when the user goes to the edit account screen, I would normally load the screen with their session held Account object.  Allow the user to edit their data and then throw it at a repository method as descibed above.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Not any more!&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Up to the point where the user logs in is unchanged.  However, the object that is returned to me by my login method now has to be detached from the context - a step that I must remember any time that I want to keep and object out of the db, fiddle with it (edit it), and then eventually persist it back to the db.  Then it is put in the session for later use.  Once the user edits their account I have to get an original copy of the object (I am guessing so that the context is aware of it???) and then attempt to persist my object (with changes) back to the db.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;I now have this code for getting the Account by username:&lt;/p&gt;  &lt;p&gt;public Account GetAccountByUsername(string Username) &lt;/p&gt;  &lt;p&gt;        { &lt;/p&gt;  &lt;p&gt;            Account result = null; &lt;/p&gt;  &lt;p&gt;            using (RanchBuddyEntities dc = connection.GetContext()) &lt;/p&gt;  &lt;p&gt;            { &lt;/p&gt;  &lt;p&gt;result = dc.AccountSet.Where(a =&amp;gt; a.Username == Username).FirstOrDefault(); &lt;/p&gt;  &lt;p&gt;                dc.Detach(result); &lt;/p&gt;  &lt;p&gt;            } &lt;/p&gt;  &lt;p&gt;            return result; &lt;/p&gt;  &lt;p&gt;        } &lt;/p&gt;  &lt;p&gt;If the account that is returned from a username search matches the supplied password then the account object here goes into my session.  Notice that at the bottom of my query above I have a dc.Detach(result) statement to remove it from the context.  From what I have read so far I have to do this so that I can re-attach it later on or keep a copy of the original object with me everywhere I go.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Then comes my save code.&lt;/p&gt;  &lt;p&gt;using (RanchBuddyEntities dc = connection.GetContext()) &lt;/p&gt;  &lt;p&gt;                { &lt;/p&gt;  &lt;p&gt;                    if(account.AccountID &amp;gt; 0) &lt;/p&gt;  &lt;p&gt;                    { &lt;/p&gt;  &lt;p&gt;                        Account original = dc.AccountSet.Where(a =&amp;gt; a.AccountID == account.AccountID).FirstOrDefault(); &lt;/p&gt;  &lt;p&gt;                        dc.ApplyPropertyChanges("AccountSet",account); &lt;/p&gt;  &lt;p&gt;                    } &lt;/p&gt;  &lt;p&gt;                    else &lt;/p&gt;  &lt;p&gt;                    { &lt;/p&gt;  &lt;p&gt;                        dc.AddToAccountSet(account); &lt;/p&gt;  &lt;p&gt;                    } &lt;/p&gt;  &lt;p&gt;                    dc.SaveChanges(); &lt;/p&gt;  &lt;p&gt;                } &lt;/p&gt;  &lt;p&gt;In this code I now have to get the original object into the context (as I don't carry the original object around with me just in case I need it and I guess the context is not aware of it if I don't manually load it??), then ApplyPropertyChanges of my updated object, and finally SaveChanges() on the context.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;I would love to hear if anyone has a better way of working with this.  I much prefer the way I was able to do this in LINQ to SQL as there were less steps to remember and I didn't need to litter various methods with snippets so that one method would work correctly with another (when they shouldn't care about each other at all).&lt;/p&gt;  &lt;p&gt;-----------------------------------------------------------------------------------&lt;/p&gt;  &lt;p&gt;I would love to hear of a better solution to this problem that shouldn’t be a problem.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130477"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130477" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/130477.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2009/03/27/entity-framework--an-entity-object-cannot-be-referenced-by.aspx</guid>
            <pubDate>Fri, 27 Mar 2009 19:12:42 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/130477.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2009/03/27/entity-framework--an-entity-object-cannot-be-referenced-by.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/130477.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/130477.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2009/03/27/entity-framework--an-entity-object-cannot-be-referenced-by.aspx</feedburner:origLink></item>
        <item>
            <title>Entity Framework : At first glance the LINQ to SQL team didn&amp;rsquo;t transition fast enough!</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/vlI9qlr2YEw/entity-framework-ndash-at-first-glance-the-linq-to-sql.aspx</link>
            <description>&lt;p&gt;I started looking at the latest the EF team had to offer and while things have progressed immensely over the years it appears that there is still some room for improvement.  Given the turmoil over the possible demise of LINQ to SQL I know that the use of Entity Framework is inevitable for me and probably just around the corner.  &lt;/p&gt; &lt;p&gt;With my newest project I have started to plug in an ADO.NET Entity Data Model (EDMX) where I would normally plug in LINQ to SQL Classes (DBML).  I still dropped the file into my Domain directory so that all the classes that are generated show up where I would expect them.  I then connect to my database in the Server Explorer, expand my database, then expand tables, and drag over all of my tables unto the new Entity design surface.  This creates a bunch of classes for me named exactly as my tables are named?  ARGH!  This is the first pain point.  I rename each and every table from a plural form to a single form.  With this corrected I can then go in and edit my Connection() helper class to return Entities instead of a DataContext.&lt;/p&gt; &lt;p&gt;From this… &lt;br /&gt;&lt;nobr&gt;&lt;font color="#000000"&gt;0:&lt;/font&gt;      &lt;span style="color: #00ffff"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #00ffff"&gt;class&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #00ff00"&gt;Connection&lt;/span&gt; &lt;br /&gt;&lt;nobr&gt;&lt;font color="#000000"&gt;1:&lt;/font&gt;  &lt;/nobr&gt;&lt;span style="color: #000000"&gt;    {&lt;/span&gt; &lt;br /&gt;&lt;nobr&gt;&lt;font color="#000000"&gt;2:&lt;/font&gt;         &lt;/nobr&gt;&lt;span style="color: #00ffff"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt; RanchBuddyDataContext GetContext()&lt;/span&gt; &lt;br /&gt;&lt;nobr&gt;&lt;font color="#000000"&gt;3:&lt;/font&gt;          {&lt;/nobr&gt; &lt;br /&gt;&lt;nobr&gt;&lt;font color="#000000"&gt;4:&lt;/font&gt;             &lt;/nobr&gt;&lt;span style="color: #00ffff"&gt;string&lt;/span&gt;&lt;span style="color: #000000"&gt; connString = &lt;/span&gt;&lt;span style="color: #00ff00"&gt;ConfigurationService&lt;/span&gt;&lt;span style="color: #000000"&gt;.GetRanchBuddyEntitiesConnectionString();&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="#000000"&gt;5:&lt;/font&gt;              RanchBuddyDataContext dc =&lt;/nobr&gt;&lt;span style="color: #00ffff"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; RanchBuddyDataContext(connString);&lt;/span&gt; &lt;br /&gt;&lt;nobr&gt;&lt;font color="#000000"&gt;6:&lt;/font&gt;              dc.CommandTimeout = 60;&lt;/nobr&gt; &lt;br /&gt;&lt;nobr&gt;&lt;font color="#000000"&gt;7:&lt;/font&gt;             &lt;/nobr&gt;&lt;span style="color: #00ffff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt; dc;&lt;/span&gt; &lt;br /&gt;&lt;nobr&gt;&lt;font color="#000000"&gt;8:&lt;/font&gt;          }&lt;/nobr&gt; &lt;br /&gt;&lt;nobr&gt;&lt;font color="#000000"&gt;9:&lt;/font&gt;      }&lt;/nobr&gt; &lt;br /&gt;&lt;/nobr&gt; &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre&gt;To this…&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;0:&lt;/font&gt;   &lt;span style="color: #00ffff"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #00ffff"&gt;class&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #00ff00"&gt;Connection&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;1:&lt;/font&gt;  &lt;span style="color: #000000"&gt;    {&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;2:&lt;/font&gt;   &lt;span style="color: #00ffff"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #00ff00"&gt;RanchBuddyEntities&lt;/span&gt;&lt;span style="color: #000000"&gt; GetContext()&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;3:&lt;/font&gt;   {&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;4:&lt;/font&gt;   &lt;span style="color: #00ffff"&gt;string&lt;/span&gt;&lt;span style="color: #000000"&gt; connString = &lt;/span&gt;&lt;span style="color: #00ff00"&gt;ConfigurationService&lt;/span&gt;&lt;span style="color: #000000"&gt;.GetRanchBuddyEntitiesConnectionString();&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;5:&lt;/font&gt;   &lt;span style="color: #00ff00"&gt;RanchBuddyEntities&lt;/span&gt;&lt;span style="color: #000000"&gt; dc = &lt;/span&gt;&lt;span style="color: #00ffff"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #00ff00"&gt;RanchBuddyEntities&lt;/span&gt;&lt;span style="color: #000000"&gt;(connString);&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;6:&lt;/font&gt;   dc.CommandTimeout = 60;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;7:&lt;/font&gt;   &lt;span style="color: #00ffff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt; dc;&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;8:&lt;/font&gt;   }&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;9:&lt;/font&gt;   }&lt;/nobr&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;That was pretty easy! I can now start to create my repository layer which connects to my database through the Entity Framework. The syntax is a little different but mostly the same. And once you get the hang of it it is very easy to get to work.  Where I used to select directly from DataContext.TableCollection I now have to do something like this to select a record:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;0:&lt;/font&gt;   &lt;span style="color: #00ffff"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #00ff00"&gt;Account&lt;/span&gt;&lt;span style="color: #000000"&gt; GetAccountByUsername(&lt;/span&gt;&lt;span style="color: #00ffff"&gt;string&lt;/span&gt;&lt;span style="color: #000000"&gt; Username)&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;1:&lt;/font&gt;   {&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;2:&lt;/font&gt;   &lt;span style="color: #00ff00"&gt;Account&lt;/span&gt;&lt;span style="color: #000000"&gt; result = &lt;/span&gt;&lt;span style="color: #00ffff"&gt;null&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;3:&lt;/font&gt;   &lt;span style="color: #00ffff"&gt;using&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="color: #00ff00"&gt;RanchBuddyEntities&lt;/span&gt;&lt;span style="color: #000000"&gt; dc = connection.GetContext())&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;4:&lt;/font&gt;   {&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;5:&lt;/font&gt;   result = dc.AccountSet.Where(a =&amp;gt; a.Username == Username).FirstOrDefault();&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;6:&lt;/font&gt;   }&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;7:&lt;/font&gt;   &lt;span style="color: #00ffff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt; result;&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;8:&lt;/font&gt;   }&lt;/nobr&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;&lt;/pre&gt;
&lt;p&gt;Something like this to save a record:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;0:&lt;/font&gt;   &lt;span style="color: #00ffff"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #00ff00"&gt;RepositoryStatus&lt;/span&gt;&lt;span style="color: #000000"&gt; SaveAccount(&lt;/span&gt;&lt;span style="color: #00ff00"&gt;Account&lt;/span&gt;&lt;span style="color: #000000"&gt; account)&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;1:&lt;/font&gt;   {&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;2:&lt;/font&gt;   &lt;span style="color: #00ff00"&gt;RepositoryStatus&lt;/span&gt;&lt;span style="color: #000000"&gt; rs = &lt;/span&gt;&lt;span style="color: #00ffff"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #00ff00"&gt;RepositoryStatus&lt;/span&gt;&lt;span style="color: #000000"&gt;();&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;3:&lt;/font&gt;   &lt;span style="color: #00ffff"&gt;try&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;4:&lt;/font&gt;  &lt;span style="color: #000000"&gt;            {&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;5:&lt;/font&gt;   &lt;span style="color: #00ffff"&gt;using&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="color: #00ff00"&gt;RanchBuddyEntities&lt;/span&gt;&lt;span style="color: #000000"&gt; dc = connection.GetContext())&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;6:&lt;/font&gt;   {&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;7:&lt;/font&gt;   &lt;span style="color: #00ffff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;(account.AccountID &amp;gt; 0)&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;8:&lt;/font&gt;   {&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;9:&lt;/font&gt;   dc.Attach(account);&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;10:&lt;/font&gt;   }&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;11:&lt;/font&gt;   &lt;span style="color: #00ffff"&gt;else&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;12:&lt;/font&gt;  &lt;span style="color: #000000"&gt;                    {&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;13:&lt;/font&gt;   dc.AddToAccountSet(account);&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;14:&lt;/font&gt;   }&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;15:&lt;/font&gt;   dc.SaveChanges();&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;16:&lt;/font&gt;   }&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;17:&lt;/font&gt;   rs.SetObject(account);&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;18:&lt;/font&gt;   rs.AddMessage(&lt;span style="color: #ff00ff"&gt;"Your account was successfully saved!"&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;19:&lt;/font&gt;   rs.StatusType = &lt;span style="color: #00ff00"&gt;Status&lt;/span&gt;&lt;span style="color: #000000"&gt;.&lt;/span&gt;&lt;span style="color: #00ff00"&gt;StatusTypes&lt;/span&gt;&lt;span style="color: #000000"&gt;.Success;&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;20:&lt;/font&gt;   }&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;21:&lt;/font&gt;   &lt;span style="color: #00ffff"&gt;catch&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #00ff00"&gt;Exception&lt;/span&gt;&lt;span style="color: #000000"&gt; e)&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;22:&lt;/font&gt;   {&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;23:&lt;/font&gt;   rs.SetObject(account);&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;24:&lt;/font&gt;   rs.AddMessage(e.Message + e.StackTrace);&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;25:&lt;/font&gt;   rs.StatusType = &lt;span style="color: #00ff00"&gt;Status&lt;/span&gt;&lt;span style="color: #000000"&gt;.&lt;/span&gt;&lt;span style="color: #00ff00"&gt;StatusTypes&lt;/span&gt;&lt;span style="color: #000000"&gt;.Failure;&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;26:&lt;/font&gt;   }&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;27:&lt;/font&gt;   &lt;span style="color: #00ffff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt; rs;&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;28:&lt;/font&gt;   }&lt;/nobr&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;&lt;/pre&gt;
&lt;p&gt;And something like this to delete a record:&lt;/p&gt;
&lt;p&gt;&lt;nobr&gt;&lt;font color="black"&gt;0:&lt;/font&gt;          &lt;span style="color: #00ffff"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #00ff00"&gt;RepositoryStatus&lt;/span&gt;&lt;span style="color: #000000"&gt; DeleteAccount(&lt;/span&gt;&lt;span style="color: #00ff00"&gt;Account&lt;/span&gt;&lt;span style="color: #000000"&gt; account)&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;1:&lt;/font&gt;          {&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;2:&lt;/font&gt;             &lt;span style="color: #00ff00"&gt;RepositoryStatus&lt;/span&gt;&lt;span style="color: #000000"&gt; rs =&lt;/span&gt;&lt;span style="color: #00ffff"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #00ff00"&gt;RepositoryStatus&lt;/span&gt;&lt;span style="color: #000000"&gt;();&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;3:&lt;/font&gt;             &lt;span style="color: #00ffff"&gt;try&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;4:&lt;/font&gt;  &lt;span style="color: #000000"&gt;            {&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;5:&lt;/font&gt;                 &lt;span style="color: #00ffff"&gt;using&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="color: #00ff00"&gt;RanchBuddyEntities&lt;/span&gt;&lt;span style="color: #000000"&gt; dc = connection.GetContext())&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;6:&lt;/font&gt;                  {&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;7:&lt;/font&gt;                      dc.Attach(account);&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;8:&lt;/font&gt;                      dc.DeleteObject(account);&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;9:&lt;/font&gt;                      dc.SaveChanges();&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;10:&lt;/font&gt;                  }&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;11:&lt;/font&gt;                  rs.SetObject(&lt;span style="color: #00ffff"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #00ffff"&gt;object&lt;/span&gt;&lt;span style="color: #000000"&gt;());&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;12:&lt;/font&gt;                  rs.AddMessage(&lt;span style="color: #ff00ff"&gt;"Your account was successfully deleted!"&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;13:&lt;/font&gt;                  rs.StatusType =&lt;span style="color: #00ff00"&gt;Status&lt;/span&gt;&lt;span style="color: #000000"&gt;.&lt;/span&gt;&lt;span style="color: #00ff00"&gt;StatusTypes&lt;/span&gt;&lt;span style="color: #000000"&gt;.Success;&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;14:&lt;/font&gt;              }&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;15:&lt;/font&gt;             &lt;span style="color: #00ffff"&gt;catch&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #00ff00"&gt;Exception&lt;/span&gt;&lt;span style="color: #000000"&gt; e)&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;16:&lt;/font&gt;              {&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;17:&lt;/font&gt;                  rs.SetObject(&lt;span style="color: #00ffff"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #00ffff"&gt;object&lt;/span&gt;&lt;span style="color: #000000"&gt;());&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;18:&lt;/font&gt;                  rs.AddMessage(e.Message + e.StackTrace);&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;19:&lt;/font&gt;                  rs.StatusType =&lt;span style="color: #00ff00"&gt;Status&lt;/span&gt;&lt;span style="color: #000000"&gt;.&lt;/span&gt;&lt;span style="color: #00ff00"&gt;StatusTypes&lt;/span&gt;&lt;span style="color: #000000"&gt;.Failure;&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;20:&lt;/font&gt;              }&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;21:&lt;/font&gt;             &lt;span style="color: #00ffff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt; rs;&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;22:&lt;/font&gt;          }&lt;/nobr&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;p&gt;In some ways this is actually easier than working with LINQ to SQL. Let’s continue on.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Ok, I added a column to one of my previously included tables. In LINQ to SQL I would just delete the entity and re-drag it to the design surface. Let’s do that here for EF. Deleting the entity works great.  Now let’s re-add the table.  Wait…it won’t let me?  What is that about.  Apparently there are issues with the designer that don’t quite clean every thing out as one might expect.  Deleting the entity only removed it from the view.  As far as EF is concerned the entity is still in play!  To really delete the table so that you can re-add it you have to dig into the EDMX and remove all references to that table!  FUN FUN FUN.&lt;/p&gt;
&lt;p&gt;With the table deleted, then all references to the table deleted, I am now able to add my table back to the design surface.  Cool.  Close the design surface and let’s do something else.  (this only happens now and then…but bare with me!) Oh wait…re-open the design surface real quick and let’s do a bit more work there.  Wait…what’s this…Visual Studio periodically forgets how to open an EDMX file you say?  Guess what…the only way to correct this issue is to close your solution and reload it!  The other stuff I can live with.  But this particular issue is sort of lame!&lt;/p&gt;
&lt;p&gt;All in all and especially since I have no choice – working with the Entity Framework doesn’t seem like brain surgery just yet.  I am hoping that all the issues I had working with disconnected contexts and many to many tables is rectified.  Also, I am hoping that having all the relationships left intact doesn’t cause me the same pains as LINQ to SQL did…guess I can always turn them off like I tend to do in LINQ to SQL.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=129817"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=129817" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/129817.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2009/03/03/entity-framework-ndash-at-first-glance-the-linq-to-sql.aspx</guid>
            <pubDate>Tue, 03 Mar 2009 19:52:27 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/129817.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2009/03/03/entity-framework-ndash-at-first-glance-the-linq-to-sql.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/129817.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/129817.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2009/03/03/entity-framework-ndash-at-first-glance-the-linq-to-sql.aspx</feedburner:origLink></item>
        <item>
            <title>MVC Attributes via ActionFilterAttribute</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/UqsgEN8BxbE/mvc-attributes-via-actionfilterattribute-again.aspx</link>
            <description>&lt;p&gt;I needed an attribute to decorate methods/controllers to protect them from being accessed by users that are not logged in.  If I were using a .net provider for authentication I could use the [Authorize] attribute that is provided in the MVC framework.  However, in this case I chose to create my own security.  This means that I need to also create my own [Authorize] attribute (as I love it’s simplicity!).  Finding the way to do this is not that straight forward.  So here is the custom attribute.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt;&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt; &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt; &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;0:&lt;/font&gt;  &lt;span style="color: #0000ff"&gt;public&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;MustBeLoggedInAttribute&lt;/span&gt;&lt;span style="color: #0000ff"&gt; : &lt;/span&gt;&lt;span style="color: #a31515"&gt;ActionFilterAttribute&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;1:&lt;/font&gt;  {&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;2:&lt;/font&gt;   &lt;span style="color: #0000ff"&gt;private&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;WebContext&lt;/span&gt;&lt;span style="color: #0000ff"&gt; _webContext;&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;3:&lt;/font&gt;   &lt;span style="color: #0000ff"&gt;public&lt;/span&gt;&lt;span style="color: #0000ff"&gt; MustBeLoggedInAttribute()&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;4:&lt;/font&gt;   {&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;5:&lt;/font&gt;   _webContext = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;WebContext&lt;/span&gt;&lt;span style="color: #0000ff"&gt;();&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;6:&lt;/font&gt;   }&lt;/nobr&gt;&lt;br /&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;7:&lt;/font&gt;   &lt;span style="color: #0000ff"&gt;public&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;override&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #0000ff"&gt; OnActionExecuting(&lt;/span&gt;&lt;span style="color: #a31515"&gt;ActionExecutingContext&lt;/span&gt;&lt;span style="color: #0000ff"&gt; filterContext)&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;8:&lt;/font&gt;   {&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;9:&lt;/font&gt;   &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #0000ff"&gt;(_webContext.Account == &lt;/span&gt;&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;&lt;span style="color: #0000ff"&gt;)&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;10:&lt;/font&gt;   {&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;11:&lt;/font&gt;   &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&lt;span style="color: #0000ff"&gt; loginUrl = &lt;/span&gt;&lt;span style="color: #ff00ff"&gt;"~/Account/Login"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;;&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;12:&lt;/font&gt;   filterContext.HttpContext.Response.Redirect(loginUrl);&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;13:&lt;/font&gt;   }&lt;/nobr&gt;&lt;br /&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;14:&lt;/font&gt;   &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;&lt;span style="color: #0000ff"&gt;.OnActionExecuting(filterContext);&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;15:&lt;/font&gt;   }&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;16:&lt;/font&gt;  }&lt;/nobr&gt;&lt;br /&gt;&lt;/pre&gt;/pre&amp;gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/div&gt;
&lt;p&gt;And to use this new attribute simply decorate the method you want protect.&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
&lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
&lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;0:&lt;/font&gt;  [&lt;span style="color: #0000ff"&gt;MustBeLoggedIn&lt;/span&gt;&lt;span style="color: #000000"&gt;]&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;1:&lt;/font&gt;  &lt;span style="color: #a31515"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;ActionResult&lt;/span&gt;&lt;span style="color: #000000"&gt; ChangePassword(&lt;/span&gt;&lt;span style="color: #a31515"&gt;string&lt;/span&gt;&lt;span style="color: #000000"&gt; currentPassword, &lt;/span&gt;&lt;span style="color: #a31515"&gt;string&lt;/span&gt;&lt;span style="color: #000000"&gt; newPassword, &lt;/span&gt;&lt;span style="color: #a31515"&gt;string&lt;/span&gt;&lt;span style="color: #000000"&gt; confirmPassword)&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;2:&lt;/font&gt;  {&lt;/nobr&gt;&lt;br /&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;3:&lt;/font&gt;   ViewData[&lt;span style="color: #008000"&gt;"Title"&lt;/span&gt;&lt;span style="color: #000000"&gt;] = &lt;/span&gt;&lt;span style="color: #008000"&gt;"Change Password"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;4:&lt;/font&gt;   &lt;span style="color: #ff0000"&gt;// Non-POST requests should just display the ChangePassword form &lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;5:&lt;/font&gt;  &lt;span style="color: #000000"&gt;    &lt;/span&gt;&lt;span style="color: #a31515"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt; (Request.HttpMethod != &lt;/span&gt;&lt;span style="color: #008000"&gt;"POST"&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;6:&lt;/font&gt;   {&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;7:&lt;/font&gt;   &lt;span style="color: #a31515"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt; View();&lt;/span&gt;&lt;/nobr&gt;&lt;br /&gt;&lt;nobr&gt;&lt;font color="black"&gt;8:&lt;/font&gt;   }&lt;/nobr&gt;&lt;br /&gt;&lt;/pre&gt;/pre&amp;gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/div&gt;
&lt;p&gt;Notice that the name of the custom attribute is MustBeLoggedInAttribute but the usage of the attribute only shows MustBeLoggedIn – no Attribute!&lt;/p&gt;
&lt;p&gt;I saw several hits of not using a hard coded Redirect path by specifying the controller and action.  If someone knows this answer for the current release of MVC please post it!  For now I can stick it in a config value or something.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127178"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127178" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/127178.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2008/11/17/mvc-attributes-via-actionfilterattribute-again.aspx</guid>
            <pubDate>Tue, 18 Nov 2008 05:27:07 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/127178.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2008/11/17/mvc-attributes-via-actionfilterattribute-again.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/127178.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/127178.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2008/11/17/mvc-attributes-via-actionfilterattribute-again.aspx</feedburner:origLink></item>
        <item>
            <title>LINQ to SQL possibly being dropped by Microsoft?</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/5dhYNilp9AY/linq-to-sql-possibly-being-dropped-by-microsoft.aspx</link>
            <description>&lt;p&gt;Is anyone out there close to this subject?  My editor at RedGate sent me a link to someone’s blog post that basically took me to this link where I found a beat around the bush statement eluding to the possibility of MS dropping LINQ to SQL.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/adonet/archive/2008/10/29/update-on-linq-to-sql-and-linq-to-entities-roadmap.aspx"&gt;http://blogs.msdn.com/adonet/archive/2008/10/29/update-on-linq-to-sql-and-linq-to-entities-roadmap.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As I have several applications running on LINQ to SQL I was wondering what people’s thoughts were on this subject.  What do you think the odds are of them actually removing support and future updates to this product?  I don’t think that LINQ to Entities is quite ready to be adopted in the same way that LINQ to SQL was (and it was only sort of ready).  So what are you plans to migrate too if LINQ to SQL is to be dropped?  NHibernate?&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126584"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126584" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/126584.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2008/11/03/linq-to-sql-possibly-being-dropped-by-microsoft.aspx</guid>
            <pubDate>Mon, 03 Nov 2008 17:31:59 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/126584.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2008/11/03/linq-to-sql-possibly-being-dropped-by-microsoft.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/126584.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/126584.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2008/11/03/linq-to-sql-possibly-being-dropped-by-microsoft.aspx</feedburner:origLink></item>
        <item>
            <title>ASP.NET 3.5 Social Networking: An expert guide to building enterprise-ready social networking and community applications with ASP.NET 3.5</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/UmiaJTo3Pl8/asp.net-3.5-social-networking-an-expert-guide-to-building-enterprise-ready.aspx</link>
            <description>&lt;p&gt;My first book is finally starting to show up on the Internet!&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.amazon.com/ASP-NET-3-5-Social-Networking-Enterprise-ready/dp/1847194788/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1225408005&amp;amp;sr=8-1" href="http://www.amazon.com/ASP-NET-3-5-Social-Networking-Enterprise-ready/dp/1847194788/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1225408005&amp;amp;sr=8-1"&gt;http://www.amazon.com/ASP-NET-3-5-Social-Networking-Enterprise-ready/dp/1847194788/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1225408005&amp;amp;sr=8-1&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/ASP.NET3.5SocialNetworkingAnexpertguid.5_FFAE/image_2.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/ASP.NET3.5SocialNetworkingAnexpertguid.5_FFAE/image_thumb.png" width="240" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This book explores the creation of a social networking site or community site from the ASP.NET/C# developers point of view.  The application that is built follows an enterprise approach to building a web site and utilizes concepts such as domain driven design, repository pattern, structure map, inversion of control, test driven development, model view presenter, and ajax.  It also explores the non-technical side of a community which covers topics such as tag clouds, blogs, forums, profile and account management, etc.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126422"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126422" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/126422.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2008/10/30/asp.net-3.5-social-networking-an-expert-guide-to-building-enterprise-ready.aspx</guid>
            <pubDate>Thu, 30 Oct 2008 23:11:53 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/126422.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2008/10/30/asp.net-3.5-social-networking-an-expert-guide-to-building-enterprise-ready.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/126422.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/126422.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2008/10/30/asp.net-3.5-social-networking-an-expert-guide-to-building-enterprise-ready.aspx</feedburner:origLink></item>
        <item>
            <title>jQuery Visual Studio Intellisense released</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/rACFSZniW7k/jquery-visual-studio-intellisense-released.aspx</link>
            <description>&lt;p&gt;&lt;a title="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.6-vsdoc.js&amp;amp;can=2&amp;amp;q=" href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.6-vsdoc.js&amp;amp;can=2&amp;amp;q="&gt;http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.6-vsdoc.js&amp;amp;can=2&amp;amp;q=&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you are a jQuery fanatic, an ASP.NET developer, and a Visual Studio user take a look at the link above for excellent Intellisense integration.  If you are not yet a jQuery fanatic but meet the other requirements take a look at the link above as jQuery has been adopted by Microsoft and will be published with Visual Studio moving forward.  Good stuff.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126420"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126420" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/126420.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2008/10/30/jquery-visual-studio-intellisense-released.aspx</guid>
            <pubDate>Thu, 30 Oct 2008 22:55:51 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/126420.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2008/10/30/jquery-visual-studio-intellisense-released.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/126420.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/126420.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2008/10/30/jquery-visual-studio-intellisense-released.aspx</feedburner:origLink></item>
        <item>
            <title>StructureMap users - great article (Using the StructureMap Container independently of ObjectFactory)</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/FkPt-xhdZAA/structuremap-users---great-article-using-the-structuremap-container-independently.aspx</link>
            <description>&lt;p&gt;The developer of StructureMap (Jeremey Miller) posted a great article (to defend the product) regarding the use of StructureMap outside of the ObjectFactory:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://codebetter.com/blogs/jeremy.miller/archive/2008/09/10/using-the-structuremap-container-independently-of-objectfactory.aspx" href="http://codebetter.com/blogs/jeremy.miller/archive/2008/09/10/using-the-structuremap-container-independently-of-objectfactory.aspx"&gt;http://codebetter.com/blogs/jeremy.miller/archive/2008/09/10/using-the-structuremap-container-independently-of-objectfactory.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125188"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125188" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/125188.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2008/09/15/structuremap-users---great-article-using-the-structuremap-container-independently.aspx</guid>
            <pubDate>Mon, 15 Sep 2008 17:28:34 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/125188.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2008/09/15/structuremap-users---great-article-using-the-structuremap-container-independently.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/125188.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/125188.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2008/09/15/structuremap-users---great-article-using-the-structuremap-container-independently.aspx</feedburner:origLink></item>
        <item>
            <title>Great article comparing MVC and MVP - at a high level</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/zghEJopfUdo/great-article-comparing-mvc-and-mvp---at-a-high.aspx</link>
            <description>&lt;p&gt;&lt;a title="http://codebetter.com/blogs/kyle.baley/archive/2008/09/10/mvc-vs-mvp-a-hillbilly-s-journey.aspx" href="http://codebetter.com/blogs/kyle.baley/archive/2008/09/10/mvc-vs-mvp-a-hillbilly-s-journey.aspx"&gt;http://codebetter.com/blogs/kyle.baley/archive/2008/09/10/mvc-vs-mvp-a-hillbilly-s-journey.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I felt that a pointer to this article is worth while.  I have spent a fair bit of time trying to determine what my preference was between MVP and MVC.  I tend to lean more towards the MVP side and this article mentions directly why I like it so much more.  MVC tears out the state awareness that the standard ASP.NET web forms come with.  I spent so many years in ASP classic wiring up form and query string variables and attempting to keep track of who a user was and what they were up too.  Once ASP.NET was launched all that work mostly went away.  I would rather keep the state awareness simple and do some plumbing to achieve MVP which allows me to do TDD than go back to an environment that forces me to provide plumbing for one task (state) just to remove plumbing for another (decoupled presentation layer).  In my mind as long as you are achieving TDD and a fairly decoupled front end you are headed in the right direction.&lt;/p&gt;  &lt;p&gt;I like this last statement from the referenced post above:&lt;/p&gt;  &lt;p&gt;"So my ultimate understanding of the difference is that it is based on how intimate the View and Presenter/Controller are. In MVP, they are cosy and familiar, like cousins. In MVC, they are cold and distant, like lawyers."&lt;/p&gt;  &lt;p&gt;That sums it up for me!&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125187"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125187" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/125187.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2008/09/15/great-article-comparing-mvc-and-mvp---at-a-high.aspx</guid>
            <pubDate>Mon, 15 Sep 2008 17:16:01 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/125187.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2008/09/15/great-article-comparing-mvc-and-mvp---at-a-high.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/125187.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/125187.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2008/09/15/great-article-comparing-mvc-and-mvp---at-a-high.aspx</feedburner:origLink></item>
        <item>
            <title>Manning .NET Daily Drawing</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/XwrrkEDISAw/manning-.net-daily-drawing.aspx</link>
            <description>&lt;p&gt;&lt;b&gt;Join the Manning .NET Daily Drawing!      &lt;br /&gt;&lt;/b&gt;Until July 17, &lt;a href="http://www.manning.com/affiliate/idevaffiliate.php?id=1024_123"&gt;click here to win&lt;/a&gt; a free .NET Ebook every day,     &lt;br /&gt;and then win the Complete Manning .NET Library!&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122975"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122975" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/122975.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2008/06/18/manning-.net-daily-drawing.aspx</guid>
            <pubDate>Wed, 18 Jun 2008 20:15:58 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/122975.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2008/06/18/manning-.net-daily-drawing.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/122975.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/122975.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2008/06/18/manning-.net-daily-drawing.aspx</feedburner:origLink></item>
        <item>
            <title>UTC DateTime format and BizTalk</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/SDlYuoWDi9E/utc-datetime-format-and-biztalk.aspx</link>
            <description>&lt;p&gt;We came across an odd little issue where our message schema requires a DateTime value.  Using System.DateTime.Now does not come out in the proper format as BizTalk requires the UTC format.  UTC format follows something like this: YYYY-MM-DDThhmmss (e.g. 1997-07-12T103508)&lt;/p&gt;  &lt;p&gt;If you are working with your dates pragmatically as we currently are you can simply use System.DateTime.Now.ToString("o")&lt;/p&gt;  &lt;p&gt;We are currently working in a message assignment shape to send a response value in the form of a DateTime just to let the consumer of our web service know that BizTalk received the request.&lt;/p&gt;  &lt;p&gt;In the message assignment...&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/UTCDateTimeformatandBizTalk_9B47/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="177" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/UTCDateTimeformatandBizTalk_9B47/image_thumb.png" width="296" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Notice the System.DateTime.Now.ToString("o")...&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/UTCDateTimeformatandBizTalk_9B47/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="466" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/UTCDateTimeformatandBizTalk_9B47/image_thumb_1.png" width="644" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;(this assignment should go in one continuous line)&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122802"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122802" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/122802.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2008/06/11/utc-datetime-format-and-biztalk.aspx</guid>
            <pubDate>Wed, 11 Jun 2008 16:02:48 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/122802.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2008/06/11/utc-datetime-format-and-biztalk.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/122802.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/122802.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2008/06/11/utc-datetime-format-and-biztalk.aspx</feedburner:origLink></item>
        <item>
            <title>Accepting XmlDocuments from BizTalk, de-serializing them to XSD generated Serializable Classes, and back again!</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/Lt8yW38Ha3g/accepting-xmldocuments-from-biztalk-de-serializing-them-to-xsd-generated-serializable.aspx</link>
            <description>&lt;h1&gt;Introduction&lt;/h1&gt; &lt;p&gt;So I find myself working in a BizTalk world these days.  So most of what I am dealing with is WCF, SOA, bus, etc. related.  However, there are times when I need to write an assembly that BizTalk can use to communicate with the outside world.  The best way for BizTalk to interact with my assembly is with XmlDocuments that conform to an strongly typed XSD generated schema.  After a bit of research across many sites, several colleagues interacting with one another over this issue, and finally locating my answer after the dust settled, I decided that this topic would make a great blog post.&lt;/p&gt; &lt;p&gt;So in this post I am going to walk you through the following processes:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Define an XML structure  &lt;/li&gt;&lt;li&gt;Generate an XSD schema  &lt;/li&gt;&lt;li&gt;Generate a serializable class with the XML Schema Definition Tool (XSD.exe)  &lt;/li&gt;&lt;li&gt;Create a class/method that accepts an XmlDocument (as you would from BizTalk)  &lt;/li&gt;&lt;li&gt;De-serialize the XmlDocument to the strongly typed serializable class  &lt;/li&gt;&lt;li&gt;Work with the strongly typed serializable class  &lt;/li&gt;&lt;li&gt;Serialize the strongly typed serializable class into an XmlDocument (to act as BizTalk would so that you can test your assembly)  &lt;/li&gt;&lt;li&gt;Create a test harness to interact with our functionality&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;To get us started I have created two projects.  One to act as a ClassLibrary that would simulate what BizTalk would interact with.  The other project is a console application that will act on behalf of BizTalk itself and pass an XmlDocument into the class library project for manipulation.&lt;/p&gt; &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image12.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="453" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image12_thumb.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;h1&gt;Define an XML structure&lt;/h1&gt; &lt;p&gt;Defining an XML structure is pretty simple.  We will add an XML file to our class library project.  Right click on the "Class Library" project and select Add&amp;gt;New Item.&lt;/p&gt; &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image17.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="304" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image17_thumb.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Select the XML file option.  Change the name to Person.xml and click Add.&lt;/p&gt; &lt;p&gt;This will then open your new Person.xml file in the main window of Visual Studio.  Lets build up the XML to represent a person with contact information, address information, etc.&lt;/p&gt; &lt;p&gt; &lt;/p&gt;&lt;div style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt; &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt; &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;XML Structure for our Person entity&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="black"&gt;0:&lt;/font&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xml&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;version&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;1.0&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;encoding&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;utf-8&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; ?&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;1:&lt;/font&gt;  &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Person&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;FirstName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Andrew&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;MiddleName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Tobias&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;LastName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Siemer&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;2:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Emails&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;3:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Email&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;Type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Primary&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;asiemer@hotmail.com&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Email&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;4:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Email&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;Type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Secondary&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;andrewsiemer@gmail.com&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Email&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;5:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Emails&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;6:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Phones&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;7:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Phone&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;Type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Cell&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;661-600-0000&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Phone&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;8:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Phone&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;Type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Home&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;661-722-0000&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Phone&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;9:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Phone&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;Type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Fax&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;661-123-0000&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Phone&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;10:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Phones&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;11:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Addresses&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;12:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Address&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;Type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Home&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;13:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Street1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;1234 Some Street&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Street1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;14:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Street2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Street2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;15:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;City&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Lancaster&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;City&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;16:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;State&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Ca&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;State&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;17:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Zip&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;93536&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Zip&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;18:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Address&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;19:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Address&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;Type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Work&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;20:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Street1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;1234 Some Street&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Street1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;21:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Street2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Street2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;22:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;City&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Culver City&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;City&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;23:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;State&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Ca&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;State&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;24:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Zip&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;93536&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Zip&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;25:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Address&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;26:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Addresses&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;27:&lt;/font&gt;  &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Person&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It is important to notice that I have not only defined the structure here, I have added test data as well.  An in cases where I want repeating nodes I have added more than one set of demo data.  This will help us in the next step when we generate our schema as the code generator is smart enough to see these differences.&lt;/p&gt;
&lt;p&gt;Once we have our demo structure and data in place we can move to the next step to generate the XSD schema.&lt;/p&gt;
&lt;h1&gt;Generate an XSD schema&lt;/h1&gt;
&lt;p&gt;I don't know if this section really warrants a whole heading by itself or not... (but Google will appreciate it if no one else does!)&lt;/p&gt;
&lt;p&gt;In the XML Editor tool bar you will see a button (the furthest left button on my bar) that will generate the schema for us.&lt;/p&gt;
&lt;p&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="28" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image_11.png" width="504" border="0" /&gt; &lt;/p&gt;
&lt;p&gt;With the Person.xml file open, click the "Create Schema" button.  Once you have done this you will have the generate schema pop up in a Person.xsd tab.  &lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;div style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
&lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
&lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Generated Schema for the Person entity&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="black"&gt;0:&lt;/font&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xml&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;version&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;1.0&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;encoding&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;utf-8&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;?&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;1:&lt;/font&gt;  &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:schema&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;attributeFormDefault&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;unqualified&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;elementFormDefault&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;qualified&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;xmlns:xs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;http://www.w3.org/2001/XMLSchema&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;2:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Person&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;3:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;4:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;5:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Emails&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;6:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;7:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;8:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;maxOccurs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;unbounded&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Email&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;9:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;10:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:simpleContent&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;11:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:extension&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;base&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;xs:string&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;12:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:attribute&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;xs:string&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;use&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;required&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;13:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:extension&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;14:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:simpleContent&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;15:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;16:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;17:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;18:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;19:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;20:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Phones&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;21:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;22:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;23:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;maxOccurs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;unbounded&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Phone&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;24:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;25:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:simpleContent&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;26:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:extension&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;base&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;xs:string&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;27:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:attribute&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;xs:string&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;use&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;required&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;28:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:extension&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;29:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:simpleContent&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;30:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;31:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;32:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;33:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;34:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;35:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Addresses&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;36:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;37:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;38:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;maxOccurs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;unbounded&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Address&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;39:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;40:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;41:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Street1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;xs:string&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;42:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Street2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;43:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;City&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;xs:string&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;44:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;State&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;xs:string&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;45:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Zip&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;xs:unsignedInt&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;46:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;47:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:attribute&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;xs:string&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;use&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;required&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;48:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;49:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;50:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;51:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;52:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;53:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;54:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:attribute&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;FirstName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;xs:string&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;use&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;required&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;55:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:attribute&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;MiddleName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;xs:string&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;use&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;required&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;56:&lt;/font&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:attribute&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;LastName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;xs:string&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;use&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;required&lt;/span&gt;&lt;span style="color: #0000ff"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;57:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;58:&lt;/font&gt;   &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;59:&lt;/font&gt;  &amp;lt;/&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xs:schema&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/div&gt;
&lt;p&gt;Make sure you save this new file into your Class Library project.  Then click the "Show All Files" button.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image_13.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="30" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image_thumb_4.png" width="202" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Then right click on the ghosted Person.xsd and choose to include that file in the project.&lt;/p&gt;
&lt;p&gt;Once we have the XSD defined we can use the XSD.exe tool to generate a serializable class for us!&lt;/p&gt;
&lt;h1&gt;Generate a serializable class with XML Schema Definition Tool (XSD.exe)&lt;/h1&gt;
&lt;p&gt;The MSDN page (&lt;a title="http://msdn.microsoft.com/en-us/library/x6c1kb0s(VS.71).aspx" href="http://msdn.microsoft.com/en-us/library/x6c1kb0s(VS.71).aspx"&gt;http://msdn.microsoft.com/en-us/library/x6c1kb0s(VS.71).aspx&lt;/a&gt;) states this best: The XML Schema Definition tool generates XML schema or common language runtime classes from XDR, XML, and XSD files, or from classes in a runtime assembly.&lt;/p&gt;
&lt;p&gt;We generated our schema from a button in Visual Studio.  You could have also done it with this tool.  What we can't do in Visual Studio (perhaps yet?) is take the schema one step further and generate a class.  So, we will turn to the XSD.exe tool to generate a class from our schema.  &lt;/p&gt;
&lt;p&gt;To do this we first need to locate our XSD.exe tool.  Mine is in this directory on my machine: C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\  If you don't have that directory (do you have Visual Studio installed?) you can search for it.&lt;/p&gt;
&lt;p&gt;This is a command line tool so we will need to interact with it in one of a few possible ways.  The easiest way is to open a command window and navigate to the location of the XSD.exe's directory.  That being said, we need to make sure that the class that we generate is always in sync with our schema.  So to do this we will create a batch file to performs the generation for us in a repeatable fashion.  Then we can hook that batch file into our build process so that it generates the class first, and then builds the projects code.&lt;/p&gt;
&lt;p&gt;To do this add a text file to our Class Library project.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image_15.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="304" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image_thumb_5.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Rename the file to GenerateClasses.bat and click Add.&lt;/p&gt;
&lt;p&gt;We then need to add three lines to our new batch file.  One to navigate the command prompt to the location of the XSD.exe file.  The next line to call the XSD file with a few parameters.  And the next line so that we can see the output when we run the batch file interactively.&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;div style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
&lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
&lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Batch file to generate class in a repeatable fashion&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="black"&gt;0:&lt;/font&gt;  cd "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\"&lt;br /&gt;&lt;font color="black"&gt;1:&lt;/font&gt;  xsd "C:\Projects\BlogPosts\XsdDemo\ClassLibrary\Person.xsd" /classes /o:C:\Projects\BlogPosts\XsdDemo\ClassLibrary\&lt;br /&gt;&lt;font color="black"&gt;2:&lt;/font&gt;  pause&lt;br /&gt;&lt;/pre&gt;
&lt;div&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;/div&gt;
&lt;p&gt;CD makes the current directory the directory that is specified.  In our case we specified the location of the XSD.exe file.  Once at this location we tell the XSD executable to generate a class (with the /classes switch) from the Person XSD (with the path to the Person.xsd) that we created earlier.  We also tell XSD to place the output in our Class Library project root directory.  We then specify the pause command to see the output of XSD when in interactive mode.&lt;/p&gt;
&lt;p&gt;Once we have this batch file created we can navigate to the file and run it by double clicking on it.&lt;/p&gt;
&lt;p&gt;If you see the command prompt with some gibberish in it odds are there are extra characters in your file.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image_19.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="37" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image_thumb_7.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;This seems to be caused by Visual Studio inserting some random characters that are not seen in the editor.  Not sure exactly what it is.&lt;/p&gt;
&lt;p&gt;To fix it I delete the .bat file I created in Visual Studio and create a new text file.  I then copy my commands over to the clean .bat file.  Now it works!&lt;/p&gt;
&lt;p&gt;Now you can double click your .bat file again and all should be good.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image_21.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="73" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image_thumb_8.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Back in Visual Studio, make sure you still have show all files selected and click on the refresh button.  You should now see a plus next to your Person.xsd.  Expand this and you should also see a newly created Person.cs file.  This is your generated serializable class that represents the Person XML we started out with.&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;div style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
&lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
&lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Automagically Generated Serializable Class&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="black"&gt;0:&lt;/font&gt;  &lt;span style="color: #0000ff"&gt;//------------------------------------------------------------------------------&lt;br /&gt;&lt;font color="black"&gt;1:&lt;/font&gt;  // &amp;lt;auto-generated&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;2:&lt;/font&gt;  //     This code was generated by a tool.&lt;br /&gt;&lt;font color="black"&gt;3:&lt;/font&gt;  //     Runtime Version:2.0.50727.1434&lt;br /&gt;&lt;font color="black"&gt;4:&lt;/font&gt;  //&lt;br /&gt;&lt;font color="black"&gt;5:&lt;/font&gt;  //     Changes to this file may cause incorrect behavior and will be lost if&lt;br /&gt;&lt;font color="black"&gt;6:&lt;/font&gt;  //     the code is regenerated.&lt;br /&gt;&lt;font color="black"&gt;7:&lt;/font&gt;  // &amp;lt;/auto-generated&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;8:&lt;/font&gt;  //------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;9:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #000000"&gt;using&lt;/span&gt;&lt;span style="color: #008000"&gt; System.Xml.Serialization;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;10:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #0000ff"&gt;// &lt;br /&gt;&lt;font color="black"&gt;11:&lt;/font&gt;  // This source code was auto-generated by xsd, Version=2.0.50727.1432.&lt;br /&gt;&lt;font color="black"&gt;12:&lt;/font&gt;  // &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;13:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;14:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;[System.CodeDom.Compiler.GeneratedCodeAttribute(&lt;/span&gt;&lt;span style="color: #2b91af"&gt;"xsd"&lt;/span&gt;&lt;span style="color: #008000"&gt;, &lt;/span&gt;&lt;span style="color: #2b91af"&gt;"2.0.50727.1432"&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;15:&lt;/font&gt;  [System.&lt;/span&gt;&lt;span style="color: #ffff00"&gt;SerializableAttribute&lt;/span&gt;&lt;span style="color: #008000"&gt;()]&lt;br /&gt;&lt;font color="black"&gt;16:&lt;/font&gt;  [System.Diagnostics.&lt;/span&gt;&lt;span style="color: #ffff00"&gt;DebuggerStepThroughAttribute&lt;/span&gt;&lt;span style="color: #008000"&gt;()]&lt;br /&gt;&lt;font color="black"&gt;17:&lt;/font&gt;  [System.ComponentModel.DesignerCategoryAttribute(&lt;/span&gt;&lt;span style="color: #2b91af"&gt;"code"&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;18:&lt;/font&gt;  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=&lt;/span&gt;&lt;span style="color: #000000"&gt;true&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;19:&lt;/font&gt;  [System.Xml.Serialization.XmlRootAttribute(Namespace=&lt;/span&gt;&lt;span style="color: #2b91af"&gt;""&lt;/span&gt;&lt;span style="color: #008000"&gt;, IsNullable=&lt;/span&gt;&lt;span style="color: #000000"&gt;false&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;20:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;partial&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;class&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #ffff00"&gt;Person&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;21:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; PersonEmail[] emailsField;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;22:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; PersonPhone[] phonesField;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;23:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; PersonAddress[] addressesField;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;24:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; firstNameField;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;25:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; middleNameField;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;26:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; lastNameField;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;27:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;28:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    [System.Xml.Serialization.XmlArrayItemAttribute(&lt;/span&gt;&lt;span style="color: #2b91af"&gt;"Email"&lt;/span&gt;&lt;span style="color: #008000"&gt;, IsNullable=&lt;/span&gt;&lt;span style="color: #000000"&gt;false&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;29:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; PersonEmail[] Emails {&lt;br /&gt;&lt;font color="black"&gt;30:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;31:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.emailsField;&lt;br /&gt;&lt;font color="black"&gt;32:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;33:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;34:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.emailsField = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;35:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;36:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;37:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;38:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    [System.Xml.Serialization.XmlArrayItemAttribute(&lt;/span&gt;&lt;span style="color: #2b91af"&gt;"Phone"&lt;/span&gt;&lt;span style="color: #008000"&gt;, IsNullable=&lt;/span&gt;&lt;span style="color: #000000"&gt;false&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;39:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; PersonPhone[] Phones {&lt;br /&gt;&lt;font color="black"&gt;40:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;41:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.phonesField;&lt;br /&gt;&lt;font color="black"&gt;42:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;43:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;44:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.phonesField = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;45:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;46:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;47:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;48:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    [System.Xml.Serialization.XmlArrayItemAttribute(&lt;/span&gt;&lt;span style="color: #2b91af"&gt;"Address"&lt;/span&gt;&lt;span style="color: #008000"&gt;, IsNullable=&lt;/span&gt;&lt;span style="color: #000000"&gt;false&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;49:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; PersonAddress[] Addresses {&lt;br /&gt;&lt;font color="black"&gt;50:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;51:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.addressesField;&lt;br /&gt;&lt;font color="black"&gt;52:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;53:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;54:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.addressesField = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;55:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;56:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;57:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;58:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    [System.Xml.Serialization.XmlAttributeAttribute()]&lt;br /&gt;&lt;font color="black"&gt;59:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; FirstName {&lt;br /&gt;&lt;font color="black"&gt;60:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;61:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.firstNameField;&lt;br /&gt;&lt;font color="black"&gt;62:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;63:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;64:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.firstNameField = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;65:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;66:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;67:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;68:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    [System.Xml.Serialization.XmlAttributeAttribute()]&lt;br /&gt;&lt;font color="black"&gt;69:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; MiddleName {&lt;br /&gt;&lt;font color="black"&gt;70:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;71:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.middleNameField;&lt;br /&gt;&lt;font color="black"&gt;72:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;73:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;74:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.middleNameField = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;75:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;76:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;77:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;78:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    [System.Xml.Serialization.XmlAttributeAttribute()]&lt;br /&gt;&lt;font color="black"&gt;79:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; LastName {&lt;br /&gt;&lt;font color="black"&gt;80:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;81:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.lastNameField;&lt;br /&gt;&lt;font color="black"&gt;82:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;83:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;84:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.lastNameField = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;85:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;86:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;87:&lt;/font&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;88:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;89:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;[System.CodeDom.Compiler.GeneratedCodeAttribute(&lt;/span&gt;&lt;span style="color: #2b91af"&gt;"xsd"&lt;/span&gt;&lt;span style="color: #008000"&gt;, &lt;/span&gt;&lt;span style="color: #2b91af"&gt;"2.0.50727.1432"&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;90:&lt;/font&gt;  [System.&lt;/span&gt;&lt;span style="color: #ffff00"&gt;SerializableAttribute&lt;/span&gt;&lt;span style="color: #008000"&gt;()]&lt;br /&gt;&lt;font color="black"&gt;91:&lt;/font&gt;  [System.Diagnostics.&lt;/span&gt;&lt;span style="color: #ffff00"&gt;DebuggerStepThroughAttribute&lt;/span&gt;&lt;span style="color: #008000"&gt;()]&lt;br /&gt;&lt;font color="black"&gt;92:&lt;/font&gt;  [System.ComponentModel.DesignerCategoryAttribute(&lt;/span&gt;&lt;span style="color: #2b91af"&gt;"code"&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;93:&lt;/font&gt;  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=&lt;/span&gt;&lt;span style="color: #000000"&gt;true&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;94:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;partial&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;class&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #ffff00"&gt;PersonEmail&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;95:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; typeField;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;96:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; valueField;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;97:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;98:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    [System.Xml.Serialization.XmlAttributeAttribute()]&lt;br /&gt;&lt;font color="black"&gt;99:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; Type {&lt;br /&gt;&lt;font color="black"&gt;100:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;101:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.typeField;&lt;br /&gt;&lt;font color="black"&gt;102:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;103:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;104:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.typeField = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;105:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;106:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;107:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;108:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    [System.Xml.Serialization.XmlTextAttribute()]&lt;br /&gt;&lt;font color="black"&gt;109:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; Value {&lt;br /&gt;&lt;font color="black"&gt;110:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;111:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.valueField;&lt;br /&gt;&lt;font color="black"&gt;112:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;113:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;114:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.valueField = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;115:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;116:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;117:&lt;/font&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;118:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;119:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;[System.CodeDom.Compiler.GeneratedCodeAttribute(&lt;/span&gt;&lt;span style="color: #2b91af"&gt;"xsd"&lt;/span&gt;&lt;span style="color: #008000"&gt;, &lt;/span&gt;&lt;span style="color: #2b91af"&gt;"2.0.50727.1432"&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;120:&lt;/font&gt;  [System.&lt;/span&gt;&lt;span style="color: #ffff00"&gt;SerializableAttribute&lt;/span&gt;&lt;span style="color: #008000"&gt;()]&lt;br /&gt;&lt;font color="black"&gt;121:&lt;/font&gt;  [System.Diagnostics.&lt;/span&gt;&lt;span style="color: #ffff00"&gt;DebuggerStepThroughAttribute&lt;/span&gt;&lt;span style="color: #008000"&gt;()]&lt;br /&gt;&lt;font color="black"&gt;122:&lt;/font&gt;  [System.ComponentModel.DesignerCategoryAttribute(&lt;/span&gt;&lt;span style="color: #2b91af"&gt;"code"&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;123:&lt;/font&gt;  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=&lt;/span&gt;&lt;span style="color: #000000"&gt;true&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;124:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;partial&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;class&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #ffff00"&gt;PersonPhone&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;125:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; typeField;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;126:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; valueField;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;127:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;128:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    [System.Xml.Serialization.XmlAttributeAttribute()]&lt;br /&gt;&lt;font color="black"&gt;129:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; Type {&lt;br /&gt;&lt;font color="black"&gt;130:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;131:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.typeField;&lt;br /&gt;&lt;font color="black"&gt;132:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;133:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;134:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.typeField = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;135:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;136:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;137:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;138:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    [System.Xml.Serialization.XmlTextAttribute()]&lt;br /&gt;&lt;font color="black"&gt;139:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; Value {&lt;br /&gt;&lt;font color="black"&gt;140:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;141:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.valueField;&lt;br /&gt;&lt;font color="black"&gt;142:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;143:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;144:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.valueField = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;145:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;146:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;147:&lt;/font&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;148:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;149:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;[System.CodeDom.Compiler.GeneratedCodeAttribute(&lt;/span&gt;&lt;span style="color: #2b91af"&gt;"xsd"&lt;/span&gt;&lt;span style="color: #008000"&gt;, &lt;/span&gt;&lt;span style="color: #2b91af"&gt;"2.0.50727.1432"&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;150:&lt;/font&gt;  [System.&lt;/span&gt;&lt;span style="color: #ffff00"&gt;SerializableAttribute&lt;/span&gt;&lt;span style="color: #008000"&gt;()]&lt;br /&gt;&lt;font color="black"&gt;151:&lt;/font&gt;  [System.Diagnostics.&lt;/span&gt;&lt;span style="color: #ffff00"&gt;DebuggerStepThroughAttribute&lt;/span&gt;&lt;span style="color: #008000"&gt;()]&lt;br /&gt;&lt;font color="black"&gt;152:&lt;/font&gt;  [System.ComponentModel.DesignerCategoryAttribute(&lt;/span&gt;&lt;span style="color: #2b91af"&gt;"code"&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;153:&lt;/font&gt;  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=&lt;/span&gt;&lt;span style="color: #000000"&gt;true&lt;/span&gt;&lt;span style="color: #008000"&gt;)]&lt;br /&gt;&lt;font color="black"&gt;154:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;partial&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;class&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #ffff00"&gt;PersonAddress&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;155:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; street1Field;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;156:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;object&lt;/span&gt;&lt;span style="color: #008000"&gt; street2Field;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;157:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; cityField;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;158:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; stateField;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;159:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;uint&lt;/span&gt;&lt;span style="color: #008000"&gt; zipField;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;160:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;private&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; typeField;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;161:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;162:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; Street1 {&lt;br /&gt;&lt;font color="black"&gt;163:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;164:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.street1Field;&lt;br /&gt;&lt;font color="black"&gt;165:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;166:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;167:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.street1Field = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;168:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;169:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;170:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;171:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;object&lt;/span&gt;&lt;span style="color: #008000"&gt; Street2 {&lt;br /&gt;&lt;font color="black"&gt;172:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;173:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.street2Field;&lt;br /&gt;&lt;font color="black"&gt;174:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;175:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;176:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.street2Field = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;177:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;178:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;179:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;180:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; City {&lt;br /&gt;&lt;font color="black"&gt;181:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;182:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.cityField;&lt;br /&gt;&lt;font color="black"&gt;183:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;184:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;185:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.cityField = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;186:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;187:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;188:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;189:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; State {&lt;br /&gt;&lt;font color="black"&gt;190:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;191:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.stateField;&lt;br /&gt;&lt;font color="black"&gt;192:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;193:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;194:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.stateField = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;195:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;196:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;197:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;198:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;uint&lt;/span&gt;&lt;span style="color: #008000"&gt; Zip {&lt;br /&gt;&lt;font color="black"&gt;199:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;200:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.zipField;&lt;br /&gt;&lt;font color="black"&gt;201:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;202:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;203:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.zipField = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;204:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;205:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;206:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;///&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;remarks/&amp;gt;&lt;br /&gt;&lt;font color="black"&gt;207:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #008000"&gt;    [System.Xml.Serialization.XmlAttributeAttribute()]&lt;br /&gt;&lt;font color="black"&gt;208:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;public&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;string&lt;/span&gt;&lt;span style="color: #008000"&gt; Type {&lt;br /&gt;&lt;font color="black"&gt;209:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;get&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;210:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;return&lt;/span&gt;&lt;span style="color: #008000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.typeField;&lt;br /&gt;&lt;font color="black"&gt;211:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;212:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;set&lt;/span&gt;&lt;span style="color: #008000"&gt; {&lt;br /&gt;&lt;font color="black"&gt;213:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #000000"&gt;this&lt;/span&gt;&lt;span style="color: #008000"&gt;.typeField = &lt;/span&gt;&lt;span style="color: #000000"&gt;value&lt;/span&gt;&lt;span style="color: #008000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;214:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;215:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;216:&lt;/font&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/div&gt;
&lt;p&gt;Knowing that our schema may change we need to hook up our batch file to our build process so that each time we build the class library we have the most up to date class that represents our schema.  To do this right click on your Class Library project and select properties.  Select the Build Event tab.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image_23.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="131" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image_thumb_9.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;In the Pre-build event command line section enter the full path to your batch file.&lt;/p&gt;
&lt;p&gt;C:\Projects\BlogPosts\XsdDemo\ClassLibrary\GenerateClasses.bat&lt;/p&gt;
&lt;p&gt;Save that and we are ready.  Delete the class that we generated earlier.  Then build your solution.  Then refresh the solution explorer window.  Your Person.cs file should now be back!&lt;/p&gt;
&lt;p&gt;Now that we have all the right tools in place let's build some sample code.&lt;/p&gt;
&lt;h1&gt;Create a class/method that accepts an XmlDocument&lt;/h1&gt;
&lt;p&gt;In this section we are going to create a class that exposes methods that will simulate something that BizTalk would use.  We are going to create a method that accepts an XmlDocument representing our person schema.  We will create a method that takes in a Person and loads the phone numbers for that person.  We will also create a method that takes in a Person and loads the addresses.&lt;/p&gt;
&lt;p&gt;If you still have a class1 class in your project rename it to Worker.  Then enter the code as you see it below.&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;div style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
&lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
&lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Our Worker Class&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="black"&gt;0:&lt;/font&gt;  &lt;span style="color: #0000ff"&gt;using&lt;/span&gt;&lt;span style="color: #0000ff"&gt; System;&lt;br /&gt;&lt;font color="black"&gt;1:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt;&lt;span style="color: #0000ff"&gt; System.Collections.Generic;&lt;br /&gt;&lt;font color="black"&gt;2:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt;&lt;span style="color: #0000ff"&gt; System.IO;&lt;br /&gt;&lt;font color="black"&gt;3:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt;&lt;span style="color: #0000ff"&gt; System.Linq;&lt;br /&gt;&lt;font color="black"&gt;4:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt;&lt;span style="color: #0000ff"&gt; System.Text;&lt;br /&gt;&lt;font color="black"&gt;5:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt;&lt;span style="color: #0000ff"&gt; System.Xml;&lt;br /&gt;&lt;font color="black"&gt;6:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt;&lt;span style="color: #0000ff"&gt; System.Xml.Serialization;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;7:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt;&lt;span style="color: #0000ff"&gt; ClassLibrary&lt;br /&gt;&lt;font color="black"&gt;8:&lt;/font&gt;  {&lt;br /&gt;&lt;font color="black"&gt;9:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #808080"&gt;Worker&lt;br /&gt;&lt;font color="black"&gt;10:&lt;/font&gt;  &lt;/span&gt;&lt;span style="color: #0000ff"&gt;    {&lt;br /&gt;&lt;font color="black"&gt;11:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #808080"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #0000ff"&gt; LoadEmails(&lt;/span&gt;&lt;span style="color: #808080"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #0000ff"&gt; Person)&lt;br /&gt;&lt;font color="black"&gt;12:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;13:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;&lt;span style="color: #0000ff"&gt;;&lt;br /&gt;&lt;font color="black"&gt;14:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;15:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #808080"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #0000ff"&gt; LoadPhones(&lt;/span&gt;&lt;span style="color: #808080"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #0000ff"&gt; Person)&lt;br /&gt;&lt;font color="black"&gt;16:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;17:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;&lt;span style="color: #0000ff"&gt;;&lt;br /&gt;&lt;font color="black"&gt;18:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;19:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #808080"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #0000ff"&gt; LoadAddresses(&lt;/span&gt;&lt;span style="color: #808080"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #0000ff"&gt; Person)&lt;br /&gt;&lt;font color="black"&gt;20:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;21:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;&lt;span style="color: #0000ff"&gt;;&lt;br /&gt;&lt;font color="black"&gt;22:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;23:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;24:&lt;/font&gt;  }&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/div&gt;
&lt;p&gt;Now that we have the method signatures in place we can start to work with the XmlDocument.&lt;/p&gt;
&lt;h1&gt;De-serialize the XmlDocument to the strongly typed serializable class&lt;/h1&gt;
&lt;p&gt;Inside of our methods we are accepting the XmlDocument that our test harness (which simulates BizTalk) is going to pass into us.  Now we technically could work with this document in many ways but in our case we want to de-serialize that XmlDocument into the class that we generated with XSD.  To do this we need to make a method that we can use from all of our Load... methods.&lt;/p&gt;
&lt;p&gt;In order to make this the most flexible I will create a Generic method that allows us to specify the Type that we expect the XmlDocument to be de-serialized into.&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;div style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
&lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
&lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Deserialize method&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="black"&gt;0:&lt;/font&gt;  &lt;span style="color: #0000ff"&gt;public&lt;/span&gt;&lt;span style="color: #0000ff"&gt; T Deserialize&amp;lt;T&amp;gt;(&lt;/span&gt;&lt;span style="color: #808080"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #0000ff"&gt; document)&lt;br /&gt;&lt;font color="black"&gt;1:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;2:&lt;/font&gt;   T obj = &lt;/span&gt;&lt;span style="color: #0000ff"&gt;default&lt;/span&gt;&lt;span style="color: #0000ff"&gt;(T);&lt;br /&gt;&lt;font color="black"&gt;3:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt;&lt;span style="color: #0000ff"&gt; (&lt;/span&gt;&lt;span style="color: #808080"&gt;MemoryStream&lt;/span&gt;&lt;span style="color: #0000ff"&gt; ms = &lt;/span&gt;&lt;span style="color: #0000ff"&gt;new&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #808080"&gt;MemoryStream&lt;/span&gt;&lt;span style="color: #0000ff"&gt;())&lt;br /&gt;&lt;font color="black"&gt;4:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;5:&lt;/font&gt;   document.Save(ms);&lt;br /&gt;&lt;font color="black"&gt;6:&lt;/font&gt;   ms.Flush();&lt;br /&gt;&lt;font color="black"&gt;7:&lt;/font&gt;   ms.Seek(0, &lt;/span&gt;&lt;span style="color: #808080"&gt;SeekOrigin&lt;/span&gt;&lt;span style="color: #0000ff"&gt;.Begin);&lt;br /&gt;&lt;font color="black"&gt;8:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #808080"&gt;XmlSerializer&lt;/span&gt;&lt;span style="color: #0000ff"&gt; serializer = &lt;/span&gt;&lt;span style="color: #0000ff"&gt;new&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #808080"&gt;XmlSerializer&lt;/span&gt;&lt;span style="color: #0000ff"&gt;(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;&lt;span style="color: #0000ff"&gt;(T));&lt;br /&gt;&lt;font color="black"&gt;9:&lt;/font&gt;   obj = (T)serializer.Deserialize(ms);&lt;br /&gt;&lt;font color="black"&gt;10:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;11:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;span style="color: #0000ff"&gt; obj;&lt;br /&gt;&lt;font color="black"&gt;12:&lt;/font&gt;   }&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/div&gt;
&lt;p&gt;This method starts with the generic signature of public T Deserialize&amp;lt;T&amp;gt;(XmlDocument document).  The T provides me with a way to specify the type that I will expect my XmlDocument to be converted too.  Also, since T is specified as the return type, I am also expressing that the specified type is what I expect the method to pass back to me.&lt;/p&gt;
&lt;p&gt;I then define an object of type T.  Since I don't know the type that I will be working with in my method I have to specify that my obj instance can be the object itself or the default instance of type T.  This allows me to handle the fact that T might be a class or a struct.  That is to say that T might be on the stack or the heap.&lt;/p&gt;
&lt;p&gt;I then step into the using statement where I instantiate an instance of MemoryStream.  I will be using the MemoryStream object to hold my XmlDocuments data.  I then Flush the memory stream to make the XmlDocument present in the MemoryStream.  Because I have flushed the stream I then have to reset the stream back to the beginning so the next time that I call into the stream the XmlDocument will be accessible.&lt;/p&gt;
&lt;p&gt;With the XmlDocument ready and waiting in memory I can now turn my attention to the next step - XmlSerializer.  I create an instance of XmlSerializer and specify the type using the generic T reference.  I then pass the stream into the serailzier's Deserialize method and cast the object that is returned to my generic type T.&lt;/p&gt;
&lt;p&gt;Once this is complete I leave the scope of the using statement which means that the MemoryStream is set for destruction.&lt;/p&gt;
&lt;p&gt;I can now safely return my de-serialized object of type T.&lt;/p&gt;
&lt;h1&gt;Work with the strongly typed serializable class&lt;/h1&gt;
&lt;p&gt;Now that I have a way to take in the XmlDocument and cast it to my serialized class I can now freely work with the passed in object as I would any other class.  I will explain what I am doing in one method knowing that the other two methods do very similar tasks.&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;div style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
&lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
&lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;LoadEmails&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="black"&gt;0:&lt;/font&gt;   &lt;span style="color: #2b91af"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #000000"&gt; LoadEmails(&lt;/span&gt;&lt;span style="color: #a31515"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #000000"&gt; Person)&lt;br /&gt;&lt;font color="black"&gt;1:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;2:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;Person&lt;/span&gt;&lt;span style="color: #000000"&gt; p = Deserialize&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Person&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;(Person);&lt;br /&gt;&lt;font color="black"&gt;3:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;List&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PersonEmail&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt; emails = &lt;/span&gt;&lt;span style="color: #2b91af"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;List&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PersonEmail&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;();&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;4:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;for&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="color: #2b91af"&gt;int&lt;/span&gt;&lt;span style="color: #000000"&gt; i = 1; i &amp;lt; 4; i++)&lt;br /&gt;&lt;font color="black"&gt;5:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;6:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;PersonEmail&lt;/span&gt;&lt;span style="color: #000000"&gt; pe = &lt;/span&gt;&lt;span style="color: #2b91af"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;PersonEmail&lt;/span&gt;&lt;span style="color: #000000"&gt;();&lt;br /&gt;&lt;font color="black"&gt;7:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;switch&lt;/span&gt;&lt;span style="color: #000000"&gt; (i)&lt;br /&gt;&lt;font color="black"&gt;8:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;9:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;case&lt;/span&gt;&lt;span style="color: #000000"&gt; 1:&lt;br /&gt;&lt;font color="black"&gt;10:&lt;/font&gt;   pe.Type = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Primary"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;11:&lt;/font&gt;   pe.Value = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"asiemer@hotmail.com"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;12:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;break&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;13:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;case&lt;/span&gt;&lt;span style="color: #000000"&gt; 2:&lt;br /&gt;&lt;font color="black"&gt;14:&lt;/font&gt;   pe.Type = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Secondary"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;15:&lt;/font&gt;   pe.Value = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"andrewsiemer@gmail.com"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;16:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;break&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;17:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;case&lt;/span&gt;&lt;span style="color: #000000"&gt; 3:&lt;br /&gt;&lt;font color="black"&gt;18:&lt;/font&gt;   pe.Type = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Secondary"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;19:&lt;/font&gt;   pe.Value = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"andrewsiemer@yahoo.com"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;20:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;break&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;21:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;22:&lt;/font&gt;   emails.Add(pe);&lt;br /&gt;&lt;font color="black"&gt;23:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;24:&lt;/font&gt;   p.Emails = emails.ToArray();&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;25:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt; Serialize(p);&lt;br /&gt;&lt;font color="black"&gt;26:&lt;/font&gt;   }&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;/pre&amp;gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/div&gt;
&lt;p&gt;In the LoadEmails method we are taking in the XmlDocument that represents the Person class.  We then de-serialize the XmlDocument so that we can work with the Person class directly.  I then create a generic List of type PersonEmail (another class that was generated by XSD.exe).  I then create a for loop that will create 3 instances of PersonEmail and then based on the value of the int i variable will load the PersonEmail with varying data.  At the bottom of each iteration I then add the instance of the PersonEmail to my generic list of PersonEmails.  At the end of the loop I then convert the generic List to an array with the ToArray method and add that array to the Person objects Emails collection.&lt;/p&gt;
&lt;p&gt;Here are the other two methods we will work with.&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;div style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
&lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
&lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;LoadPhones and LoadAddresses methods&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="black"&gt;0:&lt;/font&gt;   &lt;span style="color: #2b91af"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #000000"&gt; LoadPhones(&lt;/span&gt;&lt;span style="color: #a31515"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #000000"&gt; Person)&lt;br /&gt;&lt;font color="black"&gt;1:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;2:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;Person&lt;/span&gt;&lt;span style="color: #000000"&gt; p = Deserialize&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Person&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;(Person);&lt;br /&gt;&lt;font color="black"&gt;3:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;List&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PersonPhone&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt; phones = &lt;/span&gt;&lt;span style="color: #2b91af"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;List&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PersonPhone&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;();&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;4:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;for&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="color: #2b91af"&gt;int&lt;/span&gt;&lt;span style="color: #000000"&gt; i = 1; i &amp;lt; 4; i++)&lt;br /&gt;&lt;font color="black"&gt;5:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;6:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;PersonPhone&lt;/span&gt;&lt;span style="color: #000000"&gt; pp = &lt;/span&gt;&lt;span style="color: #2b91af"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;PersonPhone&lt;/span&gt;&lt;span style="color: #000000"&gt;();&lt;br /&gt;&lt;font color="black"&gt;7:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;switch&lt;/span&gt;&lt;span style="color: #000000"&gt;(i)&lt;br /&gt;&lt;font color="black"&gt;8:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;9:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;case&lt;/span&gt;&lt;span style="color: #000000"&gt; 1:&lt;br /&gt;&lt;font color="black"&gt;10:&lt;/font&gt;   pp.Type = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Home"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;11:&lt;/font&gt;   pp.Value = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"661-600-1234"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;12:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;break&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;13:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;case&lt;/span&gt;&lt;span style="color: #000000"&gt; 2:&lt;br /&gt;&lt;font color="black"&gt;14:&lt;/font&gt;   pp.Type = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Cell"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;15:&lt;/font&gt;   pp.Value = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"661-555-7894"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;16:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;break&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;17:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;case&lt;/span&gt;&lt;span style="color: #000000"&gt; 3:&lt;br /&gt;&lt;font color="black"&gt;18:&lt;/font&gt;   pp.Type = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Fax"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;19:&lt;/font&gt;   pp.Value = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"661-222-7854"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;20:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;break&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;21:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;22:&lt;/font&gt;   phones.Add(pp);&lt;br /&gt;&lt;font color="black"&gt;23:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;24:&lt;/font&gt;   p.Phones = phones.ToArray();&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;25:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt; Serialize(p);&lt;br /&gt;&lt;font color="black"&gt;26:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;27:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #000000"&gt; LoadAddresses(&lt;/span&gt;&lt;span style="color: #a31515"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #000000"&gt; Person)&lt;br /&gt;&lt;font color="black"&gt;28:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;29:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;Person&lt;/span&gt;&lt;span style="color: #000000"&gt; p = Deserialize&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Person&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;(Person);&lt;br /&gt;&lt;font color="black"&gt;30:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;List&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PersonAddress&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt; addresses = &lt;/span&gt;&lt;span style="color: #2b91af"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;List&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PersonAddress&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;();&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;31:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;for&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="color: #2b91af"&gt;int&lt;/span&gt;&lt;span style="color: #000000"&gt; i = 1; i &amp;lt; 4;i++)&lt;br /&gt;&lt;font color="black"&gt;32:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;33:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;PersonAddress&lt;/span&gt;&lt;span style="color: #000000"&gt; pa = &lt;/span&gt;&lt;span style="color: #2b91af"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;PersonAddress&lt;/span&gt;&lt;span style="color: #000000"&gt;();&lt;br /&gt;&lt;font color="black"&gt;34:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;switch&lt;/span&gt;&lt;span style="color: #000000"&gt;(i)&lt;br /&gt;&lt;font color="black"&gt;35:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;36:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;case&lt;/span&gt;&lt;span style="color: #000000"&gt; 1:&lt;br /&gt;&lt;font color="black"&gt;37:&lt;/font&gt;   pa.Type = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Home"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;38:&lt;/font&gt;   pa.Street1 = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"1234 Some Street"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;39:&lt;/font&gt;   pa.Street2 = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Apt B"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;40:&lt;/font&gt;   pa.City = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Lancaster"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;41:&lt;/font&gt;   pa.State = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"California"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;42:&lt;/font&gt;   pa.Zip = 93536;&lt;br /&gt;&lt;font color="black"&gt;43:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;break&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;44:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;case&lt;/span&gt;&lt;span style="color: #000000"&gt; 2:&lt;br /&gt;&lt;font color="black"&gt;45:&lt;/font&gt;   pa.Type = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Work"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;46:&lt;/font&gt;   pa.Street1 = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"1234 Some Street"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;47:&lt;/font&gt;   pa.Street2 = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Suite 102"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;48:&lt;/font&gt;   pa.City = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Culver City"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;49:&lt;/font&gt;   pa.State = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"California"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;50:&lt;/font&gt;   pa.Zip = 90210;&lt;br /&gt;&lt;font color="black"&gt;51:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;break&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;52:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;case&lt;/span&gt;&lt;span style="color: #000000"&gt; 3:&lt;br /&gt;&lt;font color="black"&gt;53:&lt;/font&gt;   pa.Type = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Vacation"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;54:&lt;/font&gt;   pa.Street1 = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"1234 Some Street"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;55:&lt;/font&gt;   pa.Street2 = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Hut B"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;56:&lt;/font&gt;   pa.City = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Honolulu"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;57:&lt;/font&gt;   pa.State = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Hawaii"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;58:&lt;/font&gt;   pa.Zip = 12345;&lt;br /&gt;&lt;font color="black"&gt;59:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;break&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;60:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;61:&lt;/font&gt;   addresses.Add(pa);&lt;br /&gt;&lt;font color="black"&gt;62:&lt;/font&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;63:&lt;/font&gt;   p.Addresses = addresses.ToArray();&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;64:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt; Serialize(p);&lt;br /&gt;&lt;font color="black"&gt;65:&lt;/font&gt;   }&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;/pre&amp;gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/div&gt;
&lt;p&gt;This then brings us to the next section where we serialize the Person object back to an XmlDocument.&lt;/p&gt;
&lt;h1&gt;Serialize the strongly typed serializable class into an XmlDocument&lt;/h1&gt;
&lt;p&gt;Now that we are successfully converting XmlDocuments to a format that we can easily work we need to discuss getting the serializable classes back to their XmlDocument format.  To do this we will create another generic method that doesn't care what we are serializing.&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;div style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
&lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
&lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Serialize method&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="black"&gt;0:&lt;/font&gt;   &lt;span style="color: #2b91af"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #000000"&gt; Serialize&amp;lt;T&amp;gt;(T ObjectToSerialize)&lt;br /&gt;&lt;font color="black"&gt;1:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;2:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #000000"&gt; xd = &lt;/span&gt;&lt;span style="color: #2b91af"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #000000"&gt;();&lt;br /&gt;&lt;font color="black"&gt;3:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;using&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="color: #a31515"&gt;MemoryStream&lt;/span&gt;&lt;span style="color: #000000"&gt; stream = &lt;/span&gt;&lt;span style="color: #2b91af"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;MemoryStream&lt;/span&gt;&lt;span style="color: #000000"&gt;())&lt;br /&gt;&lt;font color="black"&gt;4:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;5:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;XmlSerializer&lt;/span&gt;&lt;span style="color: #000000"&gt; xs = &lt;/span&gt;&lt;span style="color: #2b91af"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;XmlSerializer&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #2b91af"&gt;typeof&lt;/span&gt;&lt;span style="color: #000000"&gt;(T));&lt;br /&gt;&lt;font color="black"&gt;6:&lt;/font&gt;   xs.Serialize(&lt;/span&gt;&lt;span style="color: #a31515"&gt;XmlWriter&lt;/span&gt;&lt;span style="color: #000000"&gt;.Create(stream), ObjectToSerialize);&lt;br /&gt;&lt;font color="black"&gt;7:&lt;/font&gt;   stream.Flush();&lt;br /&gt;&lt;font color="black"&gt;8:&lt;/font&gt;   stream.Seek(0, &lt;/span&gt;&lt;span style="color: #a31515"&gt;SeekOrigin&lt;/span&gt;&lt;span style="color: #000000"&gt;.Begin);&lt;br /&gt;&lt;font color="black"&gt;9:&lt;/font&gt;   xd.Load(stream);&lt;br /&gt;&lt;font color="black"&gt;10:&lt;/font&gt;   }&lt;br /&gt;&lt;font color="black"&gt;11:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt; xd;&lt;br /&gt;&lt;font color="black"&gt;12:&lt;/font&gt;   }&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/div&gt;
&lt;p&gt;This method also allows us to specify the type that we will be working with via T.  The first thing we do inside the method is to create a new XmlDocument.  We then specify another MemoryStream inside of a using statement (so that once we are out of the using statement the MemoryStream will be released).  Next comes an instance of the XmlSerializer.  Notice that we specify the type using the typeof method on the T variable.  We then call the Serialize method of the XmlSerializer and pass the ObjectToSerialize into the MemoryStream via a call to the XmlWriter.Create() method.  Now that we have the object waiting in the MemoryStream we again call the Flush method to save the object into the MemoryStream.  Now the Seek method is called to reset the index of the MemoryStream so that the object is accessible in the MemoryStream.  We can finally load the object from the MemoryStream into the XmlDocument via a call to the Load method.  We then exit the using statement to release the MemoryStream.  Finally we can return the XmlDocument.&lt;/p&gt;
&lt;p&gt;With all of this new functionality we can finally create a test harness to make sure that it all works.&lt;/p&gt;
&lt;h1&gt;Create a test harness to interact with our functionality&lt;/h1&gt;
&lt;p&gt;Now that we have all these cool new tools to play with lets create a test harness to verify that everything is working!  Let's get started by opening up the program.cs file in the ConsoleApplication that we created.  Now let's add a reference to your TestHarness project that references the ClassLibrary project.  Do this by right clicking on the TestHarness project and selecting add reference.  Then select the projects tab in the window that opens.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image_25.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="425" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image_thumb_10.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Select the ClassLibrary project and select ok.&lt;/p&gt;
&lt;p&gt;Now we can get to work.  In the Program class add the following logic:&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;div style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
&lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
&lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Main method of the Program class&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="black"&gt;0:&lt;/font&gt;   &lt;span style="color: #2b91af"&gt;static&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt; Main(&lt;/span&gt;&lt;span style="color: #2b91af"&gt;string&lt;/span&gt;&lt;span style="color: #000000"&gt;[] args)&lt;br /&gt;&lt;font color="black"&gt;1:&lt;/font&gt;   {&lt;br /&gt;&lt;font color="black"&gt;2:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;Worker&lt;/span&gt;&lt;span style="color: #000000"&gt; worker = &lt;/span&gt;&lt;span style="color: #2b91af"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;Worker&lt;/span&gt;&lt;span style="color: #000000"&gt;();&lt;br /&gt;&lt;font color="black"&gt;3:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #000000"&gt; xd = &lt;/span&gt;&lt;span style="color: #2b91af"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;XmlDocument&lt;/span&gt;&lt;span style="color: #000000"&gt;();&lt;br /&gt;&lt;font color="black"&gt;4:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;Person&lt;/span&gt;&lt;span style="color: #000000"&gt; p = &lt;/span&gt;&lt;span style="color: #2b91af"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #a31515"&gt;Person&lt;/span&gt;&lt;span style="color: #000000"&gt;();&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;5:&lt;/font&gt;   p.FirstName = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Andrew"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;6:&lt;/font&gt;   p.MiddleName = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Tobias"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;font color="black"&gt;7:&lt;/font&gt;   p.LastName = &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Siemer"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;8:&lt;/font&gt;   xd = worker.LoadPhones(worker.Serialize(p));&lt;br /&gt;&lt;font color="black"&gt;9:&lt;/font&gt;   p = worker.Deserialize&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Person&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;(xd);&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;10:&lt;/font&gt;   xd = worker.LoadEmails(worker.Serialize(p));&lt;br /&gt;&lt;font color="black"&gt;11:&lt;/font&gt;   p = worker.Deserialize&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Person&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;(xd);&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;12:&lt;/font&gt;   xd = worker.LoadAddresses(worker.Serialize(p));&lt;br /&gt;&lt;font color="black"&gt;13:&lt;/font&gt;   p = worker.Deserialize&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Person&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;(xd);&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;14:&lt;/font&gt;   &lt;/span&gt;&lt;span style="color: #a31515"&gt;Console&lt;/span&gt;&lt;span style="color: #000000"&gt;.Read();&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;15:&lt;/font&gt;   }&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;pre&gt;&lt;/pre&gt;&lt;div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You will notice that I have created an instance of the Worker class.  I then created an instance of the XmlDocument that we will be passing back and forth between the worker and this method.  And then comes an instance of the serializeable Person class.&lt;/p&gt;
&lt;p&gt;I then add some values to the Person class.  Then comes the calls into the Load... methods of the Worker class.  Notice that with each call into a Load method I am calling the Serialize method of the Worker class to convert my Person class to an XmlDocument.  Technically BizTalk would do this serialization on its own and would present an XmlDocument to my class library.  The response of the Load methods is then assigned to the XmlDocument instance that we have.  I then call the Deserialize method of the Worker class and assign it back to the Person class.  With each call to a new Load method I am adding more and more data to my Person class.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image_27.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="294" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/AcceptingXmlDocumentsfromBizTalkdeserial_FC49/image_thumb_11.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;As you can see in the image above all of our properties and collections are full!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121813"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121813" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/121813.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2008/04/30/accepting-xmldocuments-from-biztalk-de-serializing-them-to-xsd-generated-serializable.aspx</guid>
            <pubDate>Thu, 01 May 2008 02:58:44 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/121813.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2008/04/30/accepting-xmldocuments-from-biztalk-de-serializing-them-to-xsd-generated-serializable.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/121813.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/121813.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2008/04/30/accepting-xmldocuments-from-biztalk-de-serializing-them-to-xsd-generated-serializable.aspx</feedburner:origLink></item>
        <item>
            <title>StructureMap 101 - dynamically swapping objects</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/h9LdYpRd434/structuremap-101---dynamically-swapping-objects.aspx</link>
            <description>&lt;p&gt;I recently wrote this in an email to my co-workers.  This makes it a bit out of context here...but hopefully it will make sense!&lt;/p&gt;  &lt;p&gt;I had to refresh my mind a little bit to figure out how to programatically swap out instance momentos in StructureMap...so I figured I would send this out to you all too.   &lt;br /&gt;In case you were wondering why we are using StructureMap for newing up objects rather than just instantiating them directly (other than good design with decoupling :) )... up to this point I have not been able to produce any good reasons in this project for being able to swap out objects but just came across an instance.  I am currently working on porting our caching via .net httpcontext to caching with memcached (distributed server cloud). &lt;/p&gt;  &lt;p&gt;As a result of this we now have two objects that perform the same tasks...but with different implementation.  One that uses the cache facility with .net's HttpContext and one that uses the MemCached implementation.  The interface for both of these objects is the same.  The interface is called ICache. &lt;/p&gt;  &lt;p&gt;We have a Cache object that inherits from ICache.  We also have a MemcachedCache object that inherits from the same ICache.  We then have pluggable attributes defined for both caching classes [Pluggable("Cache")] and [Pluggable("MemCached")].  The plugin family for ICache is [PluginFamily("MemCached")].  This means that the default object to be returned by StructureMap is the MemcachedCache class as the default value for the interface's PluginFamily attribute matches the Pluggable attribute of the MemcachedCache object. &lt;/p&gt;  &lt;p&gt;However, in our tests (and possibly while performing local dev work), we would want to use the HttpContext cache to remove dependencies as much as possible and to speed along the tests.  That being said we would also want the ability to test our MemCache installations from time to time too! &lt;/p&gt;  &lt;p&gt;This can be done with the same set of unit tests with the InjectStub method that the StructureMap.ObjectFactory presents us with.&lt;/p&gt;  &lt;p&gt;ICache cache1 = ObjectFactory.GetInstance&amp;lt;ICache&amp;gt;(); //MemcachedCache caching&lt;/p&gt;  &lt;p&gt;ObjectFactory.InjectStub(typeof (ICache), new Cache());&lt;/p&gt;  &lt;p&gt;ICache cache2 = ObjectFactory.GetInstance&amp;lt;ICache&amp;gt;(); //HttpContext caching&lt;/p&gt;  &lt;p&gt;ObjectFactory.ResetDefaults();&lt;/p&gt;  &lt;p&gt;ICache cache3 = ObjectFactory.GetInstance&amp;lt;ICache&amp;gt;(); //back to the MemcachedCache caching&lt;/p&gt;  &lt;p&gt;Setting the default class can also be done in the StructureMap.Config file:&lt;/p&gt;  &lt;p&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;   &lt;br /&gt;&amp;lt;StructureMap&amp;gt;    &lt;br /&gt;  &amp;lt;Assembly Name="[assembly name]" /&amp;gt;    &lt;br /&gt;  &amp;lt;PluginFamily    &lt;br /&gt;      Assembly="[assembly name]"    &lt;br /&gt;      Type="[namespace.interface name]"    &lt;br /&gt;      DefaultKey="[MemCached or Cache]" /&amp;gt;    &lt;br /&gt;&amp;lt;/StructureMap&amp;gt;&lt;/p&gt;  &lt;p&gt;Let me know if there are any questions!&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120175"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120175" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/120175.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2008/03/03/structuremap-101---dynamically-swapping-objects.aspx</guid>
            <pubDate>Mon, 03 Mar 2008 21:44:34 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/120175.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2008/03/03/structuremap-101---dynamically-swapping-objects.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/120175.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/120175.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2008/03/03/structuremap-101---dynamically-swapping-objects.aspx</feedburner:origLink></item>
        <item>
            <title>Converting a System.Data.Linq.Binary (or timestamp) to a string and back again to avoid LINQ concurrency issues</title>
            <category>ASP.NET</category>
            <category>C#</category>
            <category>LINQ</category>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/5v2YY-JrM_0/converting-a-system.data.linq.binary-or-timestamp-to-a-string-and-back.aspx</link>
            <description>&lt;p&gt;I have been working on getting around the concurrency issues that LINQ has while working with disconnected DataContext's in an nTier environment.  I currently have a Timestamp field in all of my tables to act as a row version number to help LINQ keep track of what is going on with my data.  Up to this point I haven't had any issues as I have been working with objects that were either stored in session/cache as whole objects or I have been reconstituting the object from a new DataContext prior to updating it.  In both of these scenarios I have the current timestamp to pass back to LINQ so that LINQ is happy.&lt;/p&gt;
&lt;p&gt;This morning I found myself in a position where I didn't have the data stored in session (and didn't want to put it there either) and I didn't want to get a fresh copy from the database to update.  These two scenarios just don't work for this situation.  In reality, they don't work more often than not!  How can I get around around this Timestamp concurrency issue?&lt;/p&gt;
&lt;p&gt;After a great deal of research on some very cool ways to do things.  And some more research regarding methods that just don't work.  And after spending my whole morning trying to resolve this.  I finally stepped back from the project and took a look at the easiest approach.  What do you know - KISS worked to my advantage.&lt;/p&gt;
&lt;p&gt;Using extension methods in C# 3.0 I created two methods, TimestampToString(), and StringToTimestamp().  This allowed me to easily store the timestamp as an attribute, in a hidden field, etc. so that I could easily work with it just as I would a record ID.  Here's the code:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; TimestampToString(&lt;span class="kwrd"&gt;this&lt;/span&gt; System.Data.Linq.Binary binary)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;        {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;            &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] binarybytes = binary.ToArray();&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;            &lt;span class="kwrd"&gt;string&lt;/span&gt; result = &lt;span class="str"&gt;""&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (&lt;span class="kwrd"&gt;byte&lt;/span&gt; b &lt;span class="kwrd"&gt;in&lt;/span&gt; binarybytes)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;            {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;                result += b.ToString() + &lt;span class="str"&gt;"|"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;            }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;            result = result.Substring(0, result.Length - 1);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; result;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; System.Data.Linq.Binary StringToTimestamp(&lt;span class="kwrd"&gt;this&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; s)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;            &lt;span class="kwrd"&gt;string&lt;/span&gt;[] arr = s.Split(&lt;span class="str"&gt;'|'&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;            &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] result = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[arr.Length];&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;            &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;int&lt;/span&gt; i = 0; i &amp;lt; arr.Length; i++)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;            {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;                result[i] = Convert.ToByte(arr[i]);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;            }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; result;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        }&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;If you haven't worked with extension methods yet, you should be able to copy the above code into a static class (I called mine extensions &amp;lt;GRIN&amp;gt;).  Then you can call the new methods off of the matching data type.  So when working with a Class generated by LINQ that has a timestamp property (System.Data.Linq.Binary) you could say something along the lines of Account.Timestamp.TimestampToString();  And for any string that has a TimestampToString() generated value in it you can conversely call string.StringToTimestamp().&lt;/p&gt;
&lt;p&gt;Now I will be the first to admit that this code could be cleaned up and refined.  At this point I was just happy to get it to work.  I have seen so many examples of things that just didn't work for this scenario so I felt the need to post something that did!&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119461"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119461" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/119461.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2008/02/11/converting-a-system.data.linq.binary-or-timestamp-to-a-string-and-back.aspx</guid>
            <pubDate>Mon, 11 Feb 2008 18:04:38 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/119461.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2008/02/11/converting-a-system.data.linq.binary-or-timestamp-to-a-string-and-back.aspx#feedback</comments>
            <slash:comments>24</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/119461.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/119461.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2008/02/11/converting-a-system.data.linq.binary-or-timestamp-to-a-string-and-back.aspx</feedburner:origLink></item>
        <item>
            <title>LINQ .First() method throws an error if there are no records!</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/jvp2Oyqeq7E/linq-.first-method-throws-an-error-if-there-are-no.aspx</link>
            <description>&lt;p&gt;Egad!  So I have used the .First() method in many of my LINQ queries to make sure that my query only returns one record.  I thought this would be a great way to insure isolation of one record.  Very similar to a TOP 1 statement in SQL.  However, there is an issue with this concept.  If your TOP 1 SQL statement doesn't find any records it returns nothing.  I guess I sort of hoped that the .First() method would do something similar - say return NULL or something like that.  It doesn't!  Instead it throws an error stating "sequence contains no elements".  Not what I had hoped for.  &lt;/p&gt;  &lt;p&gt;No worries though!  There apparently was a reason for this method to find 1 or &lt;strong&gt;&lt;em&gt;flip out&lt;/em&gt;&lt;/strong&gt; as the LINQ team also provides the FirstOrDefault() method which will return NULL if no records were found.  Their documentation on the &lt;a href="http://msdn2.microsoft.com/en-us/vcsharp/aa336750.aspx#FirstSimple" target="_blank"&gt;101 LINQ Samples&lt;/a&gt; page doesn't state anything about throwing an error.  It doesn't really state anything at all about what would happen if the First() item wasn't found.  It does state however that the FirstOrDefault() method will return the default value for the requested type - IE NULL!&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119344"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119344" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/119344.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2008/02/06/linq-.first-method-throws-an-error-if-there-are-no.aspx</guid>
            <pubDate>Wed, 06 Feb 2008 21:01:44 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/119344.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2008/02/06/linq-.first-method-throws-an-error-if-there-are-no.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/119344.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/119344.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2008/02/06/linq-.first-method-throws-an-error-if-there-are-no.aspx</feedburner:origLink></item>
        <item>
            <title>LINQ to SQL - Implementing the Repository pattern</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/B_mm2AfVw-4/linq-to-sql---implementing-the-repository-pattern.aspx</link>
            <description>&lt;p&gt;I have been working for the past few days to try and figure out how to get LINQ to SQL integrated into my normal &lt;a href="http://en.wikipedia.org/wiki/Multitier_architecture" target="_blank"&gt;nTier&lt;/a&gt; environment. I have also been trying to follow along with the general principles of &lt;a href="http://en.wikipedia.org/wiki/Domain-driven_design" target="_blank"&gt;Domain Driven Design&lt;/a&gt; but am finding that there are some deficiencies in the current LINQ to SQL implementation that force a few restrictions on how I do things.&lt;/p&gt;  &lt;h1&gt;Let's first look at some of the restrictions&lt;/h1&gt;  &lt;h2&gt;Disconnected DataContext&lt;/h2&gt;  &lt;p&gt;My understanding of the LINQ to SQL DataContext is that it prefers to remain open.  The primary reason for this is that its sole purpose in life is to track the state of it's objects.  As you add new objects into your collections, modify existing objects, or delete objects, the DataContext is tracking everything.  Then you can all DataContext.SubmitChanges() and it will persist all of those changes into the database. &lt;/p&gt;  &lt;p&gt;Keeping a DataContext around for the life of a web application though just doesn't sound realistic to me!  I am very much used to the idea of opening a connection to the database, getting in, getting my job done, and getting out.  As soon as I start down the standard tiered way of thinking where I open my DataContext, get an object, close the DataContext, do some work on my object, open a new DataContext, persist my object, and finally close that DataContext - LINQ to SQL is very unhappy with me!&lt;/p&gt;  &lt;p&gt;This is just not the way that LINQ to SQL is currently designed to work!  There are many work around's to get it to work the way it was intended, but it seems to add a level of complexity to the system that I think is inappropriate. &lt;/p&gt;  &lt;p&gt;Interesting reading:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.west-wind.com/weblog/posts/246222.aspx" target="_blank"&gt;LINQ to SQL DataContext Lifetime Management&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.west-wind.com/WebLog/posts/134095.aspx" target="_blank"&gt;LINQ to SQL and attaching Entities&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;Simple object relationships&lt;/h2&gt;  &lt;p&gt;When I think about LINQ to SQL I am thinking that I have a whole ORM system similar to NHibernate that allows me to fetch an object and it's children, make some changes, push that back into the database, etc.  All seamlessly!  That has not been the case so far.  &lt;/p&gt;  &lt;p&gt;I am finding that LINQ to SQL doesn't like working with complex relationships.  This is primarily due to my working in a disconnected environment of course.  I am told that if I were to just use one DataContext that I keep alive forever - all would be fine.  I am a web developer though - not a desktop guy!  This just isn't possible.&lt;/p&gt;  &lt;p&gt;This leaves me to managing my own relationships between my objects. &lt;/p&gt;  &lt;h2&gt;Persisting child objects&lt;/h2&gt;  &lt;p&gt;In the same way that I would think LINQ to SQL would allow me to fetch and play with child objects I would think it would allow me to easily persist them.  This too doesn't appear to be the case.  When spinning up a new DataContext I have to first detach all my children objects from the parent object, then attach the parent to the DataContext, then attach the children object to the parent object, and then SubmitChanges().  This is not always 100% though!&lt;/p&gt;  &lt;h2&gt;Value Objects&lt;/h2&gt;  &lt;p&gt;Entities and Value Objects are a very important part of Domain Driven Design.  A value object is basically an object that can't exist without a parent object (or Entity).  It doesn't have any unique identifier by itself.  Where as an Entity object can exist without any help from other objects.  As far as LINQ to SQL is concerned, all objects are to be Entity objects.  This makes sense considering that LINQ needs a unique identifier in order for it to do it's job efficiently.  However, this breaks some of the concepts of Domain Driven Design!&lt;/p&gt;  &lt;h1&gt;Now let's look at how we can get around these issues&lt;/h1&gt;  &lt;h2&gt;Disconnected DataContext&lt;/h2&gt;  &lt;p&gt;When working with a disconnected nTier environment we need to be able to spin up a connection to the database, do some work, and disconnect - freeing up resources and going on our marry way.  LINQ to SQL provides some features that allows you to do this as long as you are aware of the surrounding issues with making this decision.  LINQ to SQL provides you with the Attach() method.  There are various overrides of Attach(), but the one we are most concerned with is the one that allows you to specify that the object you are attaching already exists and that you are attaching a modified version of it.&lt;/p&gt;  &lt;pre class="csharpcode"&gt;dc.Respondents.Attach(respondent, &lt;span class="kwrd"&gt;true&lt;/span&gt;);
dc.SubmitChanges();&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;h2&gt;Simple object relationships&lt;/h2&gt;

&lt;p&gt;To be totally honest with you, the easiest way I have found to work with LINQ to SQL and how it manages relationships regarding my objects is to simply remove all knowledge of my relationships.  At first this may sound a bit off, but it really does work out quite well in a Domain Driven Design where my repositories are responsible for simple fetching and persistence functionality and my services are more concerned with managing the relationships of my objects.  As soon as I decided to use LINQ to SQL in this manner, everything started to work without any problem.  No more hacked work around's to try and get it to perform as advertised!&lt;/p&gt;

&lt;h2&gt;Persisting child objects&lt;/h2&gt;

&lt;p&gt;As stated above, now that LINQ knows nothing about how my objects are related to one another, I no longer have to worry about this as an issue.  I can now directly handle my relationships at the service layer above my repositories.  If I need to save a complex object with child objects, I can pass it to a service layer which will break it apart and save out the underlying objects.  This gives me total control at this point.&lt;/p&gt;

&lt;h2&gt;Value Objects&lt;/h2&gt;

&lt;p&gt;I have yet to find a fix for this issue!  LINQ requires that our objects are unique in the system on their own merit!  I doubt this will ever change.&lt;/p&gt;

&lt;h1&gt;Putting it all together?&lt;/h1&gt;

&lt;p&gt;Now that we know about the pros and cons of LINQ to SQL in a tiered environment and understanding my suggested work around's, lets see it in action.&lt;/p&gt;

&lt;h2&gt;Connection Wrapper&lt;/h2&gt;

&lt;p&gt;My connection wrapper may be a bit more complex than you might need.  It is set up to work in an automated building/testing environment where NAnt is in control of which connection string to use.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;System;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Xml;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Company.Project.Core.Domain;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Company.Project.Core.Properties;

&lt;span style="color: blue"&gt;namespace &lt;/span&gt;Company.Project.Core.DataAccess.Impl
{
    &lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Connection
    &lt;/span&gt;{
        &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ProjectDataContext &lt;/span&gt;GetContext()
        {
            &lt;span style="color: blue"&gt;string &lt;/span&gt;connString = &lt;span style="color: #a31515"&gt;""&lt;/span&gt;;
            &lt;span style="color: blue"&gt;try
            &lt;/span&gt;{
                &lt;span style="color: #2b91af"&gt;XmlDocument &lt;/span&gt;doc = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;XmlDocument&lt;/span&gt;();
                doc.Load(&lt;span style="color: #a31515"&gt;"ConnectionStringToUse.xml"&lt;/span&gt;);

                &lt;span style="color: #2b91af"&gt;XmlNodeList &lt;/span&gt;xnl = doc.GetElementsByTagName(&lt;span style="color: #a31515"&gt;"environment"&lt;/span&gt;);
                &lt;span style="color: #2b91af"&gt;XmlElement &lt;/span&gt;xe = (&lt;span style="color: #2b91af"&gt;XmlElement&lt;/span&gt;)xnl[0];

                &lt;span style="color: blue"&gt;switch &lt;/span&gt;(xe.InnerText.ToString().ToLower())
                {
                    &lt;span style="color: blue"&gt;case &lt;/span&gt;&lt;span style="color: #a31515"&gt;"local"&lt;/span&gt;:
                        connString = &lt;span style="color: #2b91af"&gt;Settings&lt;/span&gt;.Default.ProjectConnectionStringLocal;
                        &lt;span style="color: blue"&gt;break&lt;/span&gt;;

                    &lt;span style="color: blue"&gt;case &lt;/span&gt;&lt;span style="color: #a31515"&gt;"development"&lt;/span&gt;:
                        connString = &lt;span style="color: #2b91af"&gt;Settings&lt;/span&gt;.Default.ProjectConnectionStringDevelopment;
                        &lt;span style="color: blue"&gt;break&lt;/span&gt;;

                    &lt;span style="color: blue"&gt;case &lt;/span&gt;&lt;span style="color: #a31515"&gt;"production"&lt;/span&gt;:
                        connString = &lt;span style="color: #2b91af"&gt;Settings&lt;/span&gt;.Default.ProjectConnectionStringProduction;
                        &lt;span style="color: blue"&gt;break&lt;/span&gt;;

                    &lt;span style="color: blue"&gt;default&lt;/span&gt;:
                        &lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"No connection string defined in app.config!"&lt;/span&gt;);
                }
            }
            &lt;span style="color: blue"&gt;catch
            &lt;/span&gt;{
                connString = &lt;span style="color: #2b91af"&gt;Settings&lt;/span&gt;.Default.ProjectConnectionStringLocal;
            }

            &lt;span style="color: #2b91af"&gt;ProjectDataContext &lt;/span&gt;fdc = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ProjectDataContext&lt;/span&gt;(connString);
            &lt;span style="color: blue"&gt;return &lt;/span&gt;fdc;
        }
    }
}&lt;/pre&gt;

&lt;p&gt;This of course could be greatly simplified to just return the default DataContext!&lt;/p&gt;

&lt;p&gt;Once we have this in place we can start creating a repository.  A basic repository should provide ways to get an object by ID, save an object (inserting and updating), and delete an object.  It might look something like this.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;System;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Collections.Generic;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Linq;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Text;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Company.Project.Core.Domain;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Company.Project.Core.Properties;
&lt;span style="color: blue"&gt;using &lt;/span&gt;StructureMap;

&lt;span style="color: blue"&gt;namespace &lt;/span&gt;Company.Project.Core.DataAccess.Impl
{
    [&lt;span style="color: #2b91af"&gt;Pluggable&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Default"&lt;/span&gt;)]
    &lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;RespondentRepository
    &lt;/span&gt;{
        &lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Connection &lt;/span&gt;conn;
        &lt;span style="color: blue"&gt;public &lt;/span&gt;RespondentRepository()
        {
            conn = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Connection&lt;/span&gt;();
        }

        &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Respondent &lt;/span&gt;GetRespondentByID(&lt;span style="color: #2b91af"&gt;Int32 &lt;/span&gt;RespondentID)
        {
            &lt;span style="color: #2b91af"&gt;Respondent &lt;/span&gt;result;
            &lt;span style="color: blue"&gt;using &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;ProjectDataContext &lt;/span&gt;dc = conn.GetContext())
            {
                result = dc.Respondents.Where(r =&amp;gt; r.RespondentID == RespondentID).First();
            }
            &lt;span style="color: blue"&gt;return &lt;/span&gt;result;
        }

        &lt;span style="color: blue"&gt;public void &lt;/span&gt;SaveRespondent(&lt;span style="color: #2b91af"&gt;Respondent &lt;/span&gt;respondent)
        {
            &lt;span style="color: blue"&gt;using &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;ProjectDataContext &lt;/span&gt;dc = conn.GetContext())
            {
                &lt;span style="color: blue"&gt;if &lt;/span&gt;(respondent.RespondentID &amp;gt; 0)
                {
                    dc.Respondents.Attach(respondent, &lt;span style="color: blue"&gt;true&lt;/span&gt;);
                }
                &lt;span style="color: blue"&gt;else
                &lt;/span&gt;{
                    dc.Respondents.InsertOnSubmit(respondent);
                }
                dc.SubmitChanges();
            }
        }

        &lt;span style="color: blue"&gt;public void &lt;/span&gt;DeleteRespondent(&lt;span style="color: #2b91af"&gt;Respondent &lt;/span&gt;respondent)
        {
            &lt;span style="color: blue"&gt;if &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Settings&lt;/span&gt;.Default.PerformActualDeletes)
            {
                &lt;span style="color: blue"&gt;using &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;ProjectDataContext &lt;/span&gt;dc = conn.GetContext())
                {
                    dc.Respondents.DeleteOnSubmit(respondent);
                    dc.SubmitChanges();
                }
            }
            &lt;span style="color: blue"&gt;else
            &lt;/span&gt;{
                respondent.FlaggedForDelete = &lt;span style="color: blue"&gt;true&lt;/span&gt;;
                SaveRespondent(respondent);
            }
        }
    }
}&lt;/pre&gt;

&lt;p&gt;The only thing that is not standard C# code here is the reference to StructureMap and the attribute of [Pluggable("Default")].  For more on what StructureMap is look here:&lt;/p&gt;

&lt;p&gt;&lt;a title="http://structuremap.sourceforge.net/Default.htm" href="http://structuremap.sourceforge.net/Default.htm"&gt;http://structuremap.sourceforge.net/Default.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To get started with our repository you will first notice the constructor for this class is spinning up a new instance of our Connection object.  This is important as each method will need to be able to speak with the database and they use the Connection object to do so.&lt;/p&gt;

&lt;p&gt;From there we have a GetObjectByID method.  This will perform the basic fetch functionality that all systems need.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Respondent &lt;/span&gt;GetRespondentByID(&lt;span style="color: #2b91af"&gt;Int32 &lt;/span&gt;RespondentID)
        {
            &lt;span style="color: #2b91af"&gt;Respondent &lt;/span&gt;result;
            &lt;span style="color: blue"&gt;using &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;ProjectDataContext &lt;/span&gt;dc = conn.GetContext())
            {
                result = dc.Respondents.Where(r =&amp;gt; r.RespondentID == RespondentID).First();
            }
            &lt;span style="color: blue"&gt;return &lt;/span&gt;result;
        }&lt;/pre&gt;

&lt;p&gt;One thing to notice here is that we are spinning up our DataContext inside of a using statement.  This means that the DataContext will only exist in that using statement and will be disposed of when we are through with our work.  We then call conn.GetContext() to get an instance of our DataContext.  As this is a simple selection operation I have used a Lambda to grab the record with a corresponding ID and then called .First() to insure that we will only be returning one object.  Since we are using a unique ID I should only be returning one object anyways...but better safe than sorry!  Keep in mind that when working with LINQ, some methods are deferred and the scope of the DataContext is local to the using statement.  This means that if you want to return a result set or an object you may need to create a variable that is a bit farther reaching.  In our case we declared a Respondent object which is then passed out of the method.&lt;/p&gt;

&lt;p&gt;We then get to our SaveRespondent method.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public void &lt;/span&gt;SaveRespondent(&lt;span style="color: #2b91af"&gt;Respondent &lt;/span&gt;respondent)
{
    &lt;span style="color: blue"&gt;using &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;ProjectDataContext &lt;/span&gt;dc = conn.GetContext())
    {
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(respondent.RespondentID &amp;gt; 0)
        {
            dc.Respondents.Attach(respondent, &lt;span style="color: blue"&gt;true&lt;/span&gt;);
        }
        &lt;span style="color: blue"&gt;else
        &lt;/span&gt;{
            dc.Respondents.InsertOnSubmit(respondent);
        }
        dc.SubmitChanges();
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;This method is responsible for both inserting new objects and saving existing ones.  The make up of how we retrieve an DataContext is the same as before.  In this case though we want to test the passed in object to see if it has an ID already or not.  If it doesn't have an ID then we will insert the item into the database.  Otherwise we will save it to the database.  We then SubmitChanges() to actually perform the persistence.&lt;/p&gt;

&lt;p&gt;The only thing left is to provide a way for us to easily delete an object.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public void &lt;/span&gt;DeleteRespondent(&lt;span style="color: #2b91af"&gt;Respondent &lt;/span&gt;respondent)
{
    &lt;span style="color: blue"&gt;if &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Settings&lt;/span&gt;.Default.PerformActualDeletes)
    {
        &lt;span style="color: blue"&gt;using &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;ProjectDataContext &lt;/span&gt;dc = conn.GetContext())
        {
            dc.Respondents.DeleteOnSubmit(respondent);
            dc.SubmitChanges();
        }
    }
    &lt;span style="color: blue"&gt;else
    &lt;/span&gt;{
        respondent.FlaggedForDelete = &lt;span style="color: blue"&gt;true&lt;/span&gt;;
        SaveRespondent(respondent);
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Again, the make up of how we obtain a DataContext is the same.  There is a bit more code here than is necessary.  Technically all you need is what you see in the using statement.  However, I have baked in some extra logic here that asks are we performing real time deletes or system/batch deletes later. The basic real time delete logic is this:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;ProjectDataContext &lt;/span&gt;dc = conn.GetContext())
{
    dc.Respondents.DeleteOnSubmit(respondent);
    dc.SubmitChanges();
}&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Settings.Default.PerformActualDeletes is simply a flag to determine where we are going to do the real time deletes or not.  If we are not doing real time deletes then we update the FlaggedForDelete property to true.  Then a custom process would clean out the FlaggedForDelete objects later in the evening.&lt;/p&gt;

&lt;p&gt;Once all of these methods are in place you can then start building services on top of the repository if you feel you need to.  For the most part these simple repository methods should meet your needs.  But in the case that you have a complex object, you may need a service to assemble it or disassemble it and persist it's children to the database via the repository.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119313"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119313" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/119313.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2008/02/05/linq-to-sql---implementing-the-repository-pattern.aspx</guid>
            <pubDate>Tue, 05 Feb 2008 20:52:11 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/119313.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2008/02/05/linq-to-sql---implementing-the-repository-pattern.aspx#feedback</comments>
            <slash:comments>30</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/119313.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/119313.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2008/02/05/linq-to-sql---implementing-the-repository-pattern.aspx</feedburner:origLink></item>
        <item>
            <title>Windows Live Writer - know of a better blog authoring tool?</title>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/5JmEqeZV5eQ/windows-live-writer---know-of-a-better-blog-authoring.aspx</link>
            <description>&lt;p&gt;Up until today I have always made my posts via the web interface that is provided to me at the geekswithblogs.net site.  One of my new years resolutions was that I would start to blog more with better and more article oriented content.  I have come to an understanding with myself that if I want to do this I will need to find a way that is more efficient with regards to writing my blog posts.  Something more WORD like would be great!&lt;/p&gt;  &lt;p&gt;This has led me to this application - Windows Live Writer.  It seems to be integrated with my blog provider (SubText).  That is a bonus.  Lets see how it handles publishing this simple post!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/WindowsLiveWriterknowofabetterblogauthor_A417/AndrewSiemer_Anonymous_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="96" alt="AndrewSiemer_Anonymous" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/WindowsLiveWriterknowofabetterblogauthor_A417/AndrewSiemer_Anonymous_thumb.jpg" width="96" border="0" /&gt;&lt;/a&gt;  My favorite anonymous avatar! (spell check is working great)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/WindowsLiveWriterknowofabetterblogauthor_A417/AndrewSiemer_Logo_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="96" alt="AndrewSiemer_Logo" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/WindowsLiveWriterknowofabetterblogauthor_A417/AndrewSiemer_Logo_thumb.jpg" width="96" border="0" /&gt;&lt;/a&gt; My web site avatar.  (adjusting the aspect ratio in this environment is easy enough!)&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="264" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="101"&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/WindowsLiveWriterknowofabetterblogauthor_A417/AndrewSiemer_Old_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="102" alt="AndrewSiemer_Old" src="http://geekswithblogs.net/images/geekswithblogs_net/AndrewSiemer/WindowsLiveWriter/WindowsLiveWriterknowofabetterblogauthor_A417/AndrewSiemer_Old_thumb.jpg" width="96" border="0" /&gt;&lt;/a&gt; &lt;/td&gt;        &lt;td valign="top" width="161"&gt;My very first avatar from when I first got started! I know I know...pretty funny looking.  (working with tables is easy enough!)&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Now lets post this sucker and see if it sticks?&lt;/p&gt;  &lt;p&gt;I would love to hear your opinion regarding Live Writer vs. other blog authoring environments.&lt;/p&gt;  &lt;p&gt;Andy&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119304"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119304" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/119304.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2008/02/05/windows-live-writer---know-of-a-better-blog-authoring.aspx</guid>
            <pubDate>Tue, 05 Feb 2008 17:40:12 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/119304.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2008/02/05/windows-live-writer---know-of-a-better-blog-authoring.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/119304.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/119304.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2008/02/05/windows-live-writer---know-of-a-better-blog-authoring.aspx</feedburner:origLink></item>
        <item>
            <title>ASP.NET MVC - opinions?</title>
            <category>ASP.NET</category>
            <category>Architecture</category>
            <link>http://feedproxy.google.com/~r/AndrewSiemer/~3/JC59JQLRS4s/asp.net-mvc---opinions.aspx</link>
            <description>Hello all!  I find myself looking at design patterns to see if there is anything new floating about.  Of course the new MVC framework keeps popping up everywhere.  While I have been aware that MS released the new MVC framework for ASP.NET a while ago, each time I have read about it I have found myself shying away from it in favor of MVP.  I primarily didn't like the concept of ViewState being removed or the fact that we had to go back to the old ways of tossing variables into the sky via a post or get hoping for them to come back down to us via a request.  Does anyone out there have much experience using this new framework?  Do you prefer it over MVP?  What has been your experience with it?  Do you find that any newb off the street can easily work in this new MVC environment (not that a newb can easily get around in MVP!!!)?&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119303"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119303" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/AndrewSiemer/aggbug/119303.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrew Siemer - www.andrewsiemer.com</dc:creator>
            <guid isPermaLink="false">http://geekswithblogs.net/AndrewSiemer/archive/2008/02/05/asp.net-mvc---opinions.aspx</guid>
            <pubDate>Tue, 05 Feb 2008 17:09:41 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/AndrewSiemer/comments/119303.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/AndrewSiemer/archive/2008/02/05/asp.net-mvc---opinions.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/AndrewSiemer/comments/commentRss/119303.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/AndrewSiemer/services/trackbacks/119303.aspx</trackback:ping>
        <feedburner:origLink>http://geekswithblogs.net/AndrewSiemer/archive/2008/02/05/asp.net-mvc---opinions.aspx</feedburner:origLink></item>
    </channel>
</rss>
