<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2517604042882388393</id><updated>2012-01-19T22:51:31.660Z</updated><category term='Social Media'/><category term='LINQ'/><category term='Twitter'/><category term='Continuous Integration'/><category term='jQuery'/><category term='XSLT'/><category term='dev8D'/><category term='SQL'/><category term='WINDOWS 7'/><category term='javascript'/><category term='Certification'/><category term='Microformats'/><category term='Source Control'/><category term='TFS'/><category term='Working Practices'/><category term='70-536'/><category term='Tortoise SVN'/><category term='AJAX'/><category term='Gotchas'/><category term='general'/><category term='pizza'/><category term='VS2008'/><category term='MVC3'/><category term='MSDN'/><category term='VSTS'/><category term='Community'/><category term='TDD'/><category term='DevWeek 2009'/><category term='Presto 3.0'/><category term='python'/><category term='Software Design'/><category term='DDDSW'/><category term='StructureMap'/><category term='IronRuby'/><category term='eclipse'/><category term='Zentity'/><category term='NAnt'/><category term='ASP.Net MVC'/><category term='Android'/><category term='mercurial'/><category term='BOOKS'/><category term='rant'/><category term='Cloud'/><title type='text'>Martins Antics in Software Development</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>61</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-367734917068345510</id><published>2011-12-12T23:11:00.001Z</published><updated>2011-12-12T23:11:40.761Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><title type='text'>Shropshire Dev-Net</title><content type='html'>&lt;p&gt;I’ve finally pulled my finger out and organised a user group meeting for .NET Developers in Shropshire. The rather aptly named &lt;a href="http://www.shropshiredev.net" target="_blank"&gt;Shropshire Dev-Net&lt;/a&gt; is ready to rock. I’ve got a venue, and speaker organised and hope it’ll be the start of something big for the area.&lt;/p&gt; &lt;p&gt;Many thanks to &lt;a href="http://www.wlv.ac.uk/" target="_blank"&gt;Wolverhampton University&lt;/a&gt; for providing the group with the venue and &lt;a href="https://twitter.com/markrendle" target="_blank"&gt;Mark Rendle&lt;/a&gt; for lending his support by coming to speak at the first event.&lt;/p&gt; &lt;p&gt;Please visit the &lt;a href="http://www.shropshiredev.net" target="_blank"&gt;groups web site&lt;/a&gt; for more information and follow the group on twitter &lt;a href="http://twitter.com/ShropsDevNet" target="_blank"&gt;@ShropsDevNet&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-367734917068345510?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/367734917068345510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2011/12/shropshire-dev-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/367734917068345510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/367734917068345510'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2011/12/shropshire-dev-net.html' title='Shropshire Dev-Net'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-2340232177458465909</id><published>2011-09-02T21:34:00.001+01:00</published><updated>2011-09-02T21:34:02.586+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mercurial'/><category scheme='http://www.blogger.com/atom/ns#' term='Working Practices'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Source Control'/><title type='text'>Configuring Eclipse To Use Mercurial</title><content type='html'>&lt;p&gt;This is a quick note to self on how to add a mercurial plugin into the Eclipse IDE.&lt;/p&gt; &lt;p&gt;From the toolbar in Eclipse, select &lt;strong&gt;Help&lt;/strong&gt; &amp;gt; &lt;strong&gt;Install New Software&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Add a the &lt;strong&gt;javaforge&lt;/strong&gt; site to the list of software sites as shown.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-4W4fS1IMWVQ/TmE9rZ0IklI/AAAAAAAABbI/FPlDbnYk4JQ/s1600-h/AddSoftwareSite%25255B8%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="AddSoftwareSite" border="0" alt="AddSoftwareSite" src="http://lh3.ggpht.com/-WrwBZqM23mg/TmE9r8BOPSI/AAAAAAAABbM/MeV2zGe00rY/AddSoftwareSite_thumb%25255B4%25255D.png?imgmax=800" width="592" height="474"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;After you’ve added the new site, select &lt;strong&gt;OK&lt;/strong&gt; then the available software form that site should be displayed.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-9qH916ljwzs/TmE9sd-j5bI/AAAAAAAABbQ/6fpM0pmy-L8/s1600-h/AddSoftware1%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="AddSoftware1" border="0" alt="AddSoftware1" src="http://lh4.ggpht.com/-M3cnobJWqs0/TmE9s-kbXDI/AAAAAAAABbU/r3tg60Yeh2M/AddSoftware1_thumb%25255B1%25255D.png?imgmax=800" width="594" height="557"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Select “&lt;strong&gt;MercurialEclipse&lt;/strong&gt;” and press &lt;strong&gt;“Next”&lt;/strong&gt;. You’ll be asked to install unsigned content. Hit OK, and once the installation is complete, you’ll be asked to restart eclipse. Open your project in eclipse then select the &lt;strong&gt;Team Synchronisation Perspective&lt;/strong&gt; and in the Synchronize tab, hit the erm…Synchronize button:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-WPlMMTuw2do/TmE9tMj11aI/AAAAAAAABbY/VHbrDm2LXTk/s1600-h/Synch1%25255B8%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Synch1" border="0" alt="Synch1" src="http://lh3.ggpht.com/-l1zeS5qB1BY/TmE9thT_PlI/AAAAAAAABbc/b156yzu2Ecw/Synch1_thumb%25255B6%25255D.png?imgmax=800" width="670" height="140"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You should now have Mercurial as an available synchronisation type.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-o7BWHdaI93c/TmE9uCYt-II/AAAAAAAABbg/-Jy_p1CYtjg/s1600-h/Synch2%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Synch2" border="0" alt="Synch2" src="http://lh3.ggpht.com/-t10C-2ZiGKE/TmE9uV90hBI/AAAAAAAABbk/VXtfDLXG3Mc/Synch2_thumb%25255B1%25255D.png?imgmax=800" width="529" height="437"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Select Mercurial and hit “&lt;strong&gt;Next&lt;/strong&gt;” and you’ll be prompted for the repository url and username and password details.&lt;/p&gt; &lt;p&gt;Good times!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-2340232177458465909?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/2340232177458465909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2011/09/configuring-eclipse-to-use-mercurial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/2340232177458465909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/2340232177458465909'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2011/09/configuring-eclipse-to-use-mercurial.html' title='Configuring Eclipse To Use Mercurial'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-WrwBZqM23mg/TmE9r8BOPSI/AAAAAAAABbM/MeV2zGe00rY/s72-c/AddSoftwareSite_thumb%25255B4%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-2233446154537864940</id><published>2011-08-31T14:26:00.001+01:00</published><updated>2011-08-31T14:31:01.342+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Up and Running With Android Development on Windows</title><content type='html'>&lt;p&gt;I made a bold statement at a team meeting the other day that you could go from a vanilla windows installation to writing a “hello world” application for android in an hour.&lt;br&gt;Providing you've a half decent internet connection, here's what you need to do.&lt;/p&gt; &lt;h3&gt;1. Install Java&lt;/h3&gt; &lt;p&gt;We’re going to develop our app using Java so we need to install the &lt;a href="http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html" target="_blank"&gt;Java SE Development Kit 7&lt;/a&gt;&amp;nbsp; (choose your platform) and download it. Install it using the default options.&lt;/p&gt; &lt;h3&gt;2. Install Eclipse&lt;/h3&gt; &lt;p&gt;Eclipse is the development IDE we’ll use to develop our app in. &lt;strong&gt;(Note to all the Visual Studio users: “We’re through the looking glass here people! Just go with it. It’s fine….”) &lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Browse to the &lt;a href="http://www.eclipse.org/downloads/" target="_blank"&gt;Eclipse download page&lt;/a&gt; and select “Eclipse Classic”.It doesn’t have an installer, it can be simply unzipped and ran so extract the contents of the zipped folder to your "program files" folder. It's nearly 200mb so takes a while to unzip though! Create a shortcut of the Eclipse.exe file on your desktop, then you're good to go.&lt;/p&gt; &lt;h3&gt;3. Install the Android Software Development Kit&lt;/h3&gt; &lt;p&gt;&lt;a href="http://developer.android.com/sdk/index.html" target="_blank"&gt;Download the Android SDK&lt;/a&gt; and install it.&lt;br&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;NB There is currently a spooky bug in the Android SDK installer: When you install the SDK, you may come across one the wizard screens saying "Java SE Development Kit (JDK) not found". &lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-ImM5RLq9sRM/Tl42aKuuYSI/AAAAAAAABZw/VuCLiwg4Ej8/s1600-h/AndroidSdkSetup_2%25255B4%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="AndroidSdkSetup_2" border="0" alt="AndroidSdkSetup_2" src="http://lh6.ggpht.com/-TXmln_u3n6E/Tl42apc1BnI/AAAAAAAABZ0/cngBBe5FDQU/AndroidSdkSetup_2_thumb%25255B2%25255D.png?imgmax=800" width="517" height="403"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Providing of course that you have installed the Java SDK(!), to get round this you need to simply hit the back button, then "Next" again, and the wizard will say its now been found! &lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-4zG2LNJxii0/Tl42a4X-etI/AAAAAAAABZ4/MThbbFMJWbo/s1600-h/AndroidSdkSetup_3%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="AndroidSdkSetup_3" border="0" alt="AndroidSdkSetup_3" src="http://lh4.ggpht.com/-91Md1V2lATM/Tl42be1wrtI/AAAAAAAABZ8/XXhex7gRpxA/AndroidSdkSetup_3_thumb%25255B1%25255D.png?imgmax=800" width="517" height="403"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;br&gt;Hit “Next” and select the default destination folder for the Android SDK then continue with the installation. When you reach the end of the wizard, ensure the Start SDK Manager check box is ticked then hit finish:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-5ysCQVbR3cU/Tl42b0DVh_I/AAAAAAAABaA/7XRlS4ZxaAs/s1600-h/AndroidSdkSetup_5%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="AndroidSdkSetup_5" border="0" alt="AndroidSdkSetup_5" src="http://lh5.ggpht.com/-Q94DQTKA5PI/Tl42cUsJ7sI/AAAAAAAABaE/vWgvEw732K4/AndroidSdkSetup_5_thumb%25255B1%25255D.png?imgmax=800" width="517" height="403"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This will then fire up the SDK Manager app, allowing you to choose the platform images you wish to download. I just went with the default platforms for the time being. It did take a while to download so please be patient:&lt;/p&gt; &lt;p&gt;You may get a message come up asking you if you want to restart the ABD. Hit “Yes” and you're almost done.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-pd1ZlDgU62E/Tl42c29PZ8I/AAAAAAAABaI/nD5hRQvb0OE/s1600-h/ABD_2%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="ABD_2" border="0" alt="ABD_2" src="http://lh5.ggpht.com/-iOZmknMwGXg/Tl42dE32WXI/AAAAAAAABaM/qcw9K-2W0f8/ABD_2_thumb%25255B1%25255D.png?imgmax=800" width="454" height="304"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;When the packages are installed (above), hit "close" then close down the Android SDK manager. We'll carry on with the configuration from within eclipse now.&lt;/p&gt; &lt;h3&gt;4. Configure Eclipse for Android Application Development&lt;/h3&gt; &lt;p&gt;Fire up eclipse and select a default workspace. &lt;/p&gt; &lt;p&gt;You know need to install the Android Development Tools(ADT) Plugin. Follow the instructions at &lt;a href="http://developer.android.com/sdk/eclipse-adt.html"&gt;http://developer.android.com/sdk/eclipse-adt.html&lt;/a&gt; to do this.&lt;/p&gt; &lt;p&gt;After you've restarted eclipse, you need to manually set the location of the Android SDK. &lt;/p&gt; &lt;ol&gt; &lt;li&gt;Select &lt;em&gt;Window &amp;gt; Preferences&lt;/em&gt; then in the left hand list, select "Android". &lt;/li&gt; &lt;li&gt;Browse to the location of the SDK location we downloaded earlier and hit "Apply". You'll see the SDK target list populate.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;strong&gt;NB: There is a bug in how the path to the Android SDK is resolved. If you have installed the SDK to “C:\Program Files (x86)\Android”, you need to enter “C:\Progra~2\Android\android-sdk” if you’re installing to a 64-bit machine or “C:\Progra~1\Android\android-sdk” if your installing to a 32-bit machine:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-k_34UG1zVF4/Tl42d2ldSWI/AAAAAAAABaQ/aiNdaV5o0fY/s1600-h/SDK_Path_Bug2%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="SDK_Path_Bug2" border="0" alt="SDK_Path_Bug2" src="http://lh5.ggpht.com/-OV-wcyj1Y0w/Tl42eC3yIZI/AAAAAAAABaU/XuwHpMwF-Xg/SDK_Path_Bug2_thumb%25255B1%25255D.png?imgmax=800" width="647" height="559"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;…more on this issue can be found on &lt;a href="http://stackoverflow.com/questions/3492676/invalid-command-line-parameter-when-android-execution" target="_blank"&gt;Stack Overflow&lt;/a&gt;.&lt;/p&gt; &lt;h3&gt;5. Adding a Virtual Android Device&lt;/h3&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-ZHX9-WRsBJY/Tl42eud2HsI/AAAAAAAABaY/j8BtKFMHMF0/s1600-h/Tool_Bar_AVD_Button%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Tool_Bar_AVD_Button" border="0" alt="Tool_Bar_AVD_Button" src="http://lh5.ggpht.com/-TmC1ff1bi4o/Tl42e8rzTDI/AAAAAAAABac/uSngLPTSn8A/Tool_Bar_AVD_Button_thumb%25255B1%25255D.png?imgmax=800" width="375" height="38"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;When we're developing android applications, we'll want to test them locally before deploying them to a device. To do this, we'll need to create a virtual device that we will run our app on:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Click on the AVD Button (above) on the eclipse toolbar and create a new Virtual Device, imaginatively called "TestDeviceOne".&lt;/li&gt; &lt;li&gt;Select a target O/S of "Android 2.2 - API Level 8" and SD Card size of 1 GiB&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;It'll take a couple of seconds to create the device but then it should appear in the device list as so:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-b3tNVbQV16E/Tl42f8FZOvI/AAAAAAAABag/vtkKeHrtDXs/s1600-h/AVD_Manager_1%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="AVD_Manager_1" border="0" alt="AVD_Manager_1" src="http://lh4.ggpht.com/-Irbu1rhGpwE/Tl42gItF0_I/AAAAAAAABak/QpCndOd22Rs/AVD_Manager_1_thumb%25255B1%25255D.png?imgmax=800" width="633" height="504"&gt;&lt;/a&gt;&lt;/p&gt; &lt;h3&gt;6. Creating a Hello World project&lt;/h3&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-NUdGrlMKTrg/Tl42gbFibrI/AAAAAAAABao/P2BFl6iEP6o/s1600-h/Tool_Bar_NewProject_Button%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Tool_Bar_NewProject_Button" border="0" alt="Tool_Bar_NewProject_Button" src="http://lh6.ggpht.com/-qlqveXao5Ds/Tl42gy0kPiI/AAAAAAAABas/3El9eLy9O8U/Tool_Bar_NewProject_Button_thumb%25255B1%25255D.png?imgmax=800" width="375" height="38"&gt;&lt;/a&gt;&lt;br&gt;Just to get up an running, we'll start a new Android Project from the toolbar (above) and call the project HelloWorld and select the Build Target as Android 2.2. and we’ll enter a package name of com.helloworld.demo&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-8yymNqdRyQk/Tl42hI8QYFI/AAAAAAAABaw/lzkT0DLWxrA/s1600-h/Tool_Bar_Run_Button%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Tool_Bar_Run_Button" border="0" alt="Tool_Bar_Run_Button" src="http://lh6.ggpht.com/-a2plDmAJO5k/Tl42hm81qMI/AAAAAAAABa0/FQYDUKr0aaE/Tool_Bar_Run_Button_thumb%25255B1%25255D.png?imgmax=800" width="375" height="38"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Hit the "Run As" (above) button and select "Android Application" as the way to run the project.&lt;/p&gt; &lt;p&gt;The virtual device will now spin up and load your Hello world app. (NB The virtual device takes a while to get going, but you can keep it open once it's running while you work on your app). &lt;/p&gt; &lt;p&gt;There you have it. More “Hello Worlds” than a Wrox Demo…!&lt;br&gt;&lt;/p&gt;      &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-VvrOJ0nY0mY/Tl42hw7IERI/AAAAAAAABa4/CNt3DLSsGWw/s1600-h/HelloWorld%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="HelloWorld" border="0" alt="HelloWorld" src="http://lh6.ggpht.com/-GSHAqIbqDPc/Tl42iWzaYNI/AAAAAAAABa8/XG9nOmF1-wo/HelloWorld_thumb%25255B1%25255D.png?imgmax=800" width="487" height="450"&gt;&lt;/a&gt;&lt;/p&gt;     &lt;p&gt;Let me know if I’ve missed anything out or if you managed to get the process done in &lt;strong&gt;less&lt;/strong&gt; than an hour!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-2233446154537864940?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/2233446154537864940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2011/08/up-and-running-with-android-development.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/2233446154537864940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/2233446154537864940'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2011/08/up-and-running-with-android-development.html' title='Up and Running With Android Development on Windows'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-TXmln_u3n6E/Tl42apc1BnI/AAAAAAAABZ0/cngBBe5FDQU/s72-c/AndroidSdkSetup_2_thumb%25255B2%25255D.png?imgmax=800' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-7107321316506749743</id><published>2011-08-16T23:53:00.001+01:00</published><updated>2011-08-16T23:57:30.379+01:00</updated><title type='text'>Managing Scheduled Tasks With PowerShell</title><content type='html'>&lt;p&gt;I’ve recently been designing a deployment script for a suite of console applications that will be deployed together. These console apps are ran as scheduled tasks and prior to updating the apps, it’s important to ensure they are not running. &lt;/p&gt; &lt;p&gt;Luckily, it is possible to interrogate and manage the task scheduler in powershell via COM. I’m sure there are specific modules out there but the &lt;a href="http://msdn.microsoft.com/en-us/library/aa383607%28v=VS.85%29.aspx"&gt;Task Scheduler Scripting Objects&lt;/a&gt; met my needs in this instance:&lt;/p&gt;&lt;pre class="brush: ps; font-size: 65%;"&gt;$server = "localhost"
$ts = New-Object -ComObject Schedule.Service
$ts.Connect($server)
&lt;/pre&gt;
&lt;p&gt;$ts is now an instance of the TaskService object which provides a wealth of functionality when it comes to managing tasks registered in the task scheduler.&lt;/p&gt;
&lt;p&gt;Suppose we have 3 tasks declared in the Task Scheduler that you want to check the status of:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://lh3.ggpht.com/-FcbdRGrQAic/Tkr0f2Tpy2I/AAAAAAAABW8/7Rykr7tnqPk/s1600-h/image3.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-eFayNQg2h_A/Tkr0_ADRcdI/AAAAAAAABXI/BtjBiKd804A/image_thumb1.png?imgmax=800" width="629" height="178"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;… (no prizes for guessing what they’ll be doing when they run!), and we want to ensure that none of them are running, before disabling, we can use the following.&lt;/p&gt;&lt;pre class="brush: ps; font-size: 65%;"&gt;function Get-TaskRunningState([object]$taskScheduler, [string]$taskNames){
    [bool]$result = $false
    $taskNames.split(",") | 
            foreach {
                $task = $_
                $res = $taskScheduler.GetRunningTasks(1) | 
                        Where-Object { $_.Name -eq $task }

                if($res -ne $null){
                    Write-Host $task " currently running"
                    $result = $true;
                }
            }
    $result
}

function Set-TaskEnabledState([object]$taskFolder, [string]$taskNames, [bool]$state)
{
    $taskNames.split(",") | 
        foreach {    
            $taskName = $_
            $taskFolder.GetTasks(0) |
                Where-Object { $_.Name -eq $taskName } |
                    foreach { $_.enabled = $state; }
            }
}

$taskList    = "CalculatorTask,NotepadTask,WriteTask"
$server      = "localhost"
$enableTasks = $false

try { 
    $ts = New-Object -ComObject Schedule.Service
    $ts.Connect($server)
}

catch {
  throw "Cannot connect to deployment server."
}

if ((Get-TaskRunningState -taskScheduler  $ts -taskNames $taskList) -eq $false) {
     Write-Host "Attempt to disable services.."

    try {
             $taskFolder = $ts.GetFolder("Martin");
             Set-TaskEnabledState $taskFolder $taskList $enableTasks
             Write-Host "Scheduled services enabled:" $enableTasks
    }
    catch {
               throw "One of the scheduled services could not be disabled."
        }
}
else {
      throw "One or more of the scheduled services are currently running."
}
&lt;/pre&gt;
&lt;p&gt;I declared the functions we’ll use at the top. I concatenated all the names of the scheduled services together and called Get-TaskRunningState, which would return true if any of the tasks were running. Were that the case, we’d just throw a meaningful exception at this stage. If none of the tasks are running, we can call Set-TaskEnabledState passing in the tasklist and the state we wish to set them to (false in this instance). Notice the fact that I had to resolve the Folder that the tasks are in on the scheduler, and pass that in as a parameter to the function. That’s because the TaskFolder has the GetTasks() method on it which is used to find the tasks we’re interested in.&lt;/p&gt;
&lt;p&gt;Once I’ve deployed the updated applications, I can simply call Set-TaskEnabledState, this time passing $true for the $state parameter.&lt;/p&gt;
&lt;p&gt;More info on the &lt;a href="http://msdn.microsoft.com/en-us/library/aa383448%28v=VS.85%29.aspx"&gt;TaskService API can be found on MSDN&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-7107321316506749743?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/7107321316506749743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2011/08/managing-scheduled-tasks-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/7107321316506749743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/7107321316506749743'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2011/08/managing-scheduled-tasks-with.html' title='Managing Scheduled Tasks With PowerShell'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-eFayNQg2h_A/Tkr0_ADRcdI/AAAAAAAABXI/BtjBiKd804A/s72-c/image_thumb1.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-207518648972731910</id><published>2011-07-12T20:41:00.002+01:00</published><updated>2011-11-01T15:09:21.726Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><category scheme='http://www.blogger.com/atom/ns#' term='TDD'/><category scheme='http://www.blogger.com/atom/ns#' term='Software Design'/><title type='text'>Unit Testing around AutoMapper</title><content type='html'>&lt;p&gt;I’ve been feeling the love for &lt;a href="http://automapper.codeplex.com/"&gt;AutoMapper&lt;/a&gt; for about a year now as it enables me to map between objects in different layers of my apps in a friction free and consistent manner. I’m not going to go into how to use AutoMapper as &lt;a href="http://lostechies.com/jimmybogard/"&gt;Jimmy Bogard&lt;/a&gt;, who created AutoMapper has also written some &lt;a href="http://lostechies.com/jimmybogard/category/automapper/"&gt;excellent posts on how to use it&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;I recently ran into some issues while introducing some unit tests around some code that used AutoMapper and after playing around with a couple of ideas, I came up with a really simple solution that enables you to test around it while loosening up the dependency on Automapper at the same time.&lt;/p&gt;&lt;pre class="brush: csharp; font-size: 65%;"&gt;   
public class Person
   {
       public string   FirstName      { get; set; }
       public string   Surname        { get; set; }
       public bool     HasBeenLogged  { get; set; }
   }

public class PersonForLogging
   {
       public string FullName      { get; set; }
   }
 
public class UserDetailsLogger
   {
       public void LogPerson(Person person)
       {
           var personToLog = Mapper.Map&amp;lt;Person,PersonForLogging&amp;gt;(person);
          
           /*
            * logging functionality in here... removed for this example.
            */
          
           person.HasBeenLogged = true;

           Console.WriteLine("{0} has been logged", personToLog.FullName);
       }
   }  
&lt;/pre&gt;
&lt;p&gt;Alright its a bit simplistic but it demonstrates the point! We’ve got two objects, a Person class and a PersonForLogging class. We’ve also got a UserDetailsLogger class which has one method declared called LogPerson. This method accepts a parameter of type person then immediately maps this instance to a new instance of PersonToLog. Some imaginary processing then takes place with the PersonToLog instance before setting the HasBeenLogged value on the Person object to true.&lt;/p&gt;
&lt;p&gt;A unit test for this method is displayed below.&lt;/p&gt;&lt;pre class="brush: csharp; font-size: 65%;"&gt;   
[TestFixture]
public class UserDetailsLoggerTest
   {
       [Test]
       public void LogPerson_SetsHasBeenLogged_ToTrue()
       {
           Mapper.AddProfile(new PersonMappingProfile());

           var person = new Person { FirstName = "Martin", Surname = "Evans" };
           var _subject = new UserDetailsLogger();

           _subject.LogPerson(person);
     
           Assert.IsTrue(person.HasBeenLogged);
       }
   }
&lt;/pre&gt;
&lt;p&gt;As you can see, all we’re testing for here is to check that when the LogPerson method is called, the HasBeenLogged value is set to true. But because we’re calling the Mapper.Map function which is an AutoMapper function, we have to add a mapping profile to the test case, that handles the mapping between Person and PersonToLog (PersonMappingProfile in this case, which isn’t shown). This is both a smell and potentially be a PITA because you’ll need to write that profile and associated mappings before getting the test to pass.&lt;/p&gt;
&lt;p&gt;Lets loosen our dependency on the mapping profile up a bit then.&lt;/p&gt;&lt;pre class="brush: csharp; font-size: 65%;"&gt;   
public interface IMappingService
   {
       TDest Map&amp;lt;TSrc,TDest&amp;gt;(TSrc source) where TDest : class;
   }
 
public class MappingService : IMappingService
   {
       public TDest Map&amp;lt;TSrc,TDest&amp;gt;(TSrc source) where TDest : class
       {
           return Mapper.Map&amp;lt;TSrc,TDest&amp;gt;(source);
       }
   }
 
public class UserDetailsLogger
   {
       private readonly IMappingService _mappingService;

       public UserDetailsLogger(IMappingService mappingService)
       {
           if (mappingService == null) throw new ArgumentNullException("mappingService");
           _mappingService = mappingService;
       }

       public void LogPerson(Person person)
       {
           var personToLog = _mappingService.Map&amp;lt;Person,PersonForLogging&amp;gt;(person);
          
           person.HasBeenLogged = true;

           Console.WriteLine("{0} has been logged", personToLog.FullName);
       }
   }
&lt;/pre&gt;
&lt;p&gt;We’ve now declared an Interface called IMappingService, an instance of which we pass into the UserDetails logger and invoke its single Map method during LogPerson. The concrete implementation of this method is the only place where we call the Mapper.Map method enabling us to substitute our need for any dependency on AutoMapper in our test case, where we can provide a simple stub that can be injected into the UserDetails Logger for the duration of the test:&lt;/p&gt;&lt;pre class="brush: csharp; font-size: 65%;"&gt;[TestFixture]
public class UserDetailsLoggerTest
   {
       [Test]
       public void LogPerson_SetsHasBeenLogged_ToTrue()
       {
         
           var person = new Person { FirstName = "Martin", Surname = "Evans" };
           var _subject = new UserDetailsLogger(new MappingStub());

           _subject.LogPerson(person);
     
           Assert.IsTrue(person.HasBeenLogged);
       }
   }

public class MappingStub : IMappingService
   {
       public TDest Map&amp;lt;TSrc,TDest&amp;gt;(TSrc source) where TDest : class
       {
           var ret =  new PersonForLogging { FullName = "Anything" } ;
           return ret as TDest;
       }
   }
&lt;/pre&gt;
&lt;p&gt;This method leads to using AutoMapper in a more testable manner, as you’ll be able to to test the objects you need to test, in isolation without any mapping issues getting in the way, and if you decide to use your own hand-rolled mapping api, it should prove easier to swap out.&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-207518648972731910?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/207518648972731910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2011/07/unit-testing-around-automapper.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/207518648972731910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/207518648972731910'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2011/07/unit-testing-around-automapper.html' title='Unit Testing around AutoMapper'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-7202945335232819114</id><published>2011-04-12T13:25:00.001+01:00</published><updated>2011-04-12T13:27:50.458+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DDDSW'/><title type='text'>Developer Developer Developer South West</title><content type='html'>&lt;p&gt;&lt;a title="DDD SW" href="http://www.dddsouthwest.com" target="_blank"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px 19px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" border="0" align="left" src="http://www.dddsouthwest.com/images/DDDSouthWest3BadgeMedium.png"&gt;&lt;/a&gt;I’m attending &lt;a href="http://www.dddsouthwest.com" target="_blank"&gt;DDDSW at UWE, Bristol on June 11th 2011&lt;/a&gt; with 3 other devs from &lt;a href="http://www.bybox.com/" target="_blank"&gt;ByBox&lt;/a&gt;. Being a DDD noob, I’m a little nervous but I’ve been told to expect good things!&lt;/p&gt; &lt;p&gt;The session tracks haven't been finalised as of yet but I think I could do with some Jamie Madrox type powers to get maximum benefit:&lt;/p&gt; &lt;p&gt;&lt;iframe title="YouTube video player" height="390" src="http://www.youtube.com/embed/iocEddTmkGk" frameborder="0" width="480" allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-7202945335232819114?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/7202945335232819114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2011/04/developer-developer-developer-south.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/7202945335232819114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/7202945335232819114'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2011/04/developer-developer-developer-south.html' title='Developer Developer Developer South West'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/iocEddTmkGk/default.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-3339853861628336074</id><published>2011-02-08T22:01:00.000Z</published><updated>2011-02-09T09:17:02.703Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Working Practices'/><category scheme='http://www.blogger.com/atom/ns#' term='MVC3'/><category scheme='http://www.blogger.com/atom/ns#' term='Software Design'/><title type='text'>Localising Content and Distances</title><content type='html'>&lt;p&gt;I ran into an issue recently while working on a web project regarding how journey distances should be displayed. The app I was working on, gets a journey distance in kilometres from a third party service. Given that the app is currently for use within the Great Britain, users would much rather see the distance displayed in miles, but pretty soon, it will be utilised in countries that work in kilometres.&lt;/p&gt; &lt;p&gt;I realised I’d need to write a FormatProvider that enabled the distance to be passed in as the object to be formatted appended with either “miles” or “km” depending on the language of the browser that the site was being viewed in. In essence I was wanting to build a LocalisedDistanceFormatProvider that could be used as so:&lt;/p&gt;&lt;pre class="brush: csharp;"&gt;double distance = 40;
var strOut = string.Format(new LocalisedDistanceFormatProvider(),"{0}",distance);
console.WriteLine(strOut);&lt;/pre&gt;
&lt;p&gt;and strOut would be “25 miles” if I was British or American or “40 km” if I was anywhere else. To satisfy the method signature required by the String.Format() method, I realised I’d have to pass in a format string value of “{0}” even though the output format won’t be determined by this value. In fact the format of the output string would be based on the Culture of the executing thread.&lt;/p&gt;
&lt;p&gt;Here’s what I wrote.&lt;/p&gt;&lt;pre class="brush: csharp; font-size: 65%;"&gt;    public class LocalisedDistanceFormatProvider : IFormatProvider, ICustomFormatter
    {
        #region Implementation of IFormatProvider
        public object GetFormat(Type formatType)
        {
            return formatType == typeof(ICustomFormatter) ? this : null;
        }
        #endregion

        #region Implementation of ICustomFormatter
        public string Format(string format, object arg, IFormatProvider formatProvider)
        {
            if (format != null)
            {
                throw new FormatException("No formatting string is required");
            }
            
            double distanceKm;

            if (arg is double)
            {
                distanceKm = (double)arg;
            }
            else
            {
                if (!double.TryParse(arg.ToString(), out distanceKm))
                {
                    throw new FormatException("Incorrect type");
                }
            }

            var s = System.Threading.Thread.CurrentThread.CurrentCulture.Name;

            if (s == "en-GB" || s == "en-US")
            {
                var miles = distanceKm * 0.621371192;
                return String.Format("{0} miles", miles.ToString("0"));
            }

            return String.Format("{0} km", distanceKm.ToString("0"));
        }
        #endregion
    }&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There’s a couple of interfaces used here that I normally take for granted but thought I’d dig a little deeper into them to see what they’re all about.&lt;br&gt;An object that implements &lt;strong&gt;IFormatProvider&lt;/strong&gt; only has one method&amp;nbsp; - “GetFormat”, which acts as a call back is to return an instance of an &lt;strong&gt;ICustomFormatter&lt;/strong&gt;. It is this type that which contains a “Format” method that actually does all the work.&lt;/p&gt;
&lt;p&gt;While writing this post, I had to stop and think about why we have to create an IFormatProvider which then returns an ICustomFormatter.&amp;nbsp; I suppose that the task of analysing the CurrentCulture of the thread could have been done in the GetFormat method which could then return a different instance of ICustomFormatter based on whether the value needed converting into miles or not. But it works bundled up in one object and it won’t need to be extended (….don’t quote me on that!)&lt;/p&gt;
&lt;h2&gt;Testing&lt;/h2&gt;
&lt;p&gt;There are two ways we can test our new format provider. The first one is via unit tests:&lt;/p&gt;&lt;pre class="brush: csharp;"&gt;  [TestFixture]
    public class LocalisedDistanceFormatProviderTests
    {

        private const  double Forty = 40;
        private const  string Expected40 = "40 km";
        private const  string Expected25 = "25 miles";
        private const  string ValidFormat = "{0}";
        private const  string InValidFormat = "{0:fred}";

        [Test]
        public void Format40_UICultureOf_frFR_Returns_40km()
        {
            /*** Arrange ***/           
            System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");

            /*** Act ***/
            var actual = string.Format(new LocalisedDistanceFormatProvider(), ValidFormat, Forty);

            /*** Assert ***/
            Assert.AreEqual(Expected40, actual);

        }

        [Test]
        public void Format40_UICultureOf_enGB_Returns_25miles()
        {
            /*** Arrange ***/
            System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");

            /*** Act ***/
            var actual = string.Format(new LocalisedDistanceFormatProvider(), ValidFormat, Forty);

            /*** Assert ***/
            Assert.AreEqual(Expected25, actual);
        }

        [Test]
        public void Format40_UICultureOf_enUS_Returns_25miles()
        {
            /*** Arrange ***/
            System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

            /*** Act ***/
            var actual = string.Format(new LocalisedDistanceFormatProvider(), ValidFormat, Forty);

            /*** Assert ***/
            Assert.AreEqual(Expected25, actual);
        }

        [Test]
        [ExpectedException(typeof(FormatException))]
        public void InvalidFormatUsed_Throws_FormatException()
        {
            /*** Arrange ***/
            System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

            /*** Act ***/
            string.Format(new LocalisedDistanceFormatProvider(), InValidFormat, Forty);            
        }

        [Test]
        [ExpectedException(typeof(FormatException))]
        public void CalledOnNonNumericeType_Throws_FormatException()
        {
            /*** Arrange ***/
            System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

            /*** Act ***/
            string.Format(new LocalisedDistanceFormatProvider(), ValidFormat, "fred");
        }
    }&lt;/pre&gt;
&lt;p&gt;The second way is to see the code in action along with how we can combine it with some more localised content from resource files.&lt;/p&gt;
&lt;p&gt;NB: I’ve localised (!) this demo for GB and France. Other locales are available…&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Fire up Visual Studio and create a new ASP.NET MVC3 Web application (If you haven’t got ASP.NET MVC3 yet, you can download it from &lt;a href="http://www.asp.net/mvc/mvc3" target="_blank"&gt;here&lt;/a&gt;) 
&lt;li&gt;When prompted, select “Internet Application”, using Razor as the view engine. 
&lt;li&gt;In solution explorer, add a folder to the root of the application called _Code. 
&lt;li&gt;Add a new class to the _Code folder, called LocalisedDistanceFormatProvider.cs and copy the first chunk of code displayed above, into it. 
&lt;li&gt;Now we need to add some locale specific text, so right click on the project icon in the solution explorer.&amp;nbsp; &lt;li&gt;Select Add &amp;gt; Add ASP.NET Folder &amp;gt; App_GlobalResources. 
&lt;li&gt;The Global Resources folder should now be visible within the project in the solution explorer. 
&lt;li&gt;Right click on App_GlobalResources and Select Add &amp;gt; New Item &amp;gt; Resources File 
&lt;li&gt;Name the file Resource.resx 
&lt;li&gt;Now add another resx file named Resource.FR.resx 
&lt;li&gt;In each resource file, add a string value called JourneyDistance. 
&lt;li&gt;In Resource.resx, set the value to be “The journey distance is” 
&lt;li&gt;In Resource.FR.resx set the value to be “La distance voyage est à”&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;So now we should have something like this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_prPJEj560s4/TVG9VCgD2lI/AAAAAAAABPQ/9-kqYKMq7Uk/s1600-h/Solution1%5B14%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Solution1" border="0" alt="Solution1" src="http://lh5.ggpht.com/_prPJEj560s4/TVG9WcC-HYI/AAAAAAAABPU/3SQ0YRxH2fA/Solution1_thumb%5B8%5D.png?imgmax=800" width="603" height="373"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What we’ve done so far is to define a global resource that can be accessed throughout our site. Resource.resx is our default or invariant culture version of the resource file. While the Resource.fr.resx version is the French language version. &lt;/p&gt;
&lt;p&gt;If we wanted to localise the app event further, we could add locale versions of the resource files. For instance, French is spoken in many places other than just France. Take Canada for instance. If I wanted to have a resource file for French spoken in France and French spoken in Canada I would add the following files:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Resouce.fr-FR.resx 
&lt;li&gt;Resouce.fr-CA.resx&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;This example however, only requires a neutral language resource file.&lt;/p&gt;
&lt;p&gt;In our web application, the server will look at the Accept-Language field in the header of the HTTP request, to see what language the browser wants the page to be displayed in. An .NET class called the ResourceManager will look for a matching resource file for the language requested. If such a file exists, the values will be read from it. If the file doesn’t exist the value will be read from the invariant (default) file.&lt;/p&gt;
&lt;p&gt;To programmatically read the value of JourneyDistance from our resource file, we can use the following syntax:&lt;/p&gt;&lt;pre class="brush: csharp;"&gt;var localisedMessage = Resources.Resource.JourneyDistance;&lt;/pre&gt;
&lt;p&gt;This functionality is not enabled out of the box, so we must enable the globalisation&lt;strong&gt;*&lt;/strong&gt; functionality by adding the following line into the system.web section of our web.config:&lt;/p&gt;&lt;pre class="brush: xml;"&gt;   &amp;lt;globalization culture="auto" uiCulture="auto" /&amp;gt;&lt;/pre&gt;
&lt;p&gt;Setting the culture attribute to auto sets the CurrentThread.CurrentCulture.Name value to equal the preferred language value in the request header. The culture of a thread determines the specific calendar, currency and string fomatting rules for that particular language. Setting uiCulture to auto sets the CurrentThread.CurrentUICulture.Name value to equal this value. The uiCulture is used by the ResourceManager to locate the relevant resource files. 
&lt;p&gt;Open the HomeController in our project and replace the index method with the following:&lt;pre class="brush: csharp;"&gt;        public ActionResult Index()
        {
            const int DistanceInKm = 40;

            var localisedDistance = string.Format(new LocalisedDistanceFormatProvider(), "{0}", DistanceInKm);
            var localisedMessage  = Resources.Resource.JourneyDistance;
            
            ViewBag.Message = String.Format("{0} {1}", localisedMessage, localisedDistance);

            return View();
        }&lt;/pre&gt;
&lt;p&gt;As you can see in this example, we’re combining a localised message with a localised distance value and writing it out to the ViewBag.Message field. Using my browser with the default language set up to be English, I get the following (I enabled the fire bug Net panel so you can see the Accept-Language field in the request header) 
&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_prPJEj560s4/TVG9W5nciaI/AAAAAAAABPY/AOqT9uReEqs/s1600-h/Page-en%5B3%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Page-en" border="0" alt="Page-en" src="http://lh5.ggpht.com/_prPJEj560s4/TVG9Xd3iZzI/AAAAAAAABPc/vV0AOa3E_N0/Page-en_thumb%5B1%5D.png?imgmax=800" width="507" height="448"&gt;&lt;/a&gt; 
&lt;p&gt;I then went into my browsers settings and added French to my language list and moved it to the top of the list so it became the preferred language. 
&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_prPJEj560s4/TVG9XwTRPzI/AAAAAAAABPg/9tQNArfnAik/s1600-h/image%5B7%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_prPJEj560s4/TVG9ZEEe0FI/AAAAAAAABPk/uOO3J6ukZN4/image_thumb%5B3%5D.png?imgmax=800" width="381" height="347"&gt;&lt;/a&gt; 
&lt;p&gt;Refreshing the page then gave me this… 
&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_prPJEj560s4/TVG9aEatHPI/AAAAAAAABPo/AZIOMlE3cOQ/s1600-h/Page-fr%5B4%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Page-fr" border="0" alt="Page-fr" src="http://lh3.ggpht.com/_prPJEj560s4/TVG9arsT-VI/AAAAAAAABPs/qHSXuIE7mzo/Page-fr_thumb%5B2%5D.png?imgmax=800" width="481" height="439"&gt;&lt;/a&gt; 
&lt;p&gt;…and as the French would say… “Voila!” 
&lt;p&gt;&amp;nbsp; &lt;h2&gt;Further Reading&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms227427.aspx"&gt;MSDN - ASP.NET Web Page Resources Overview&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.iformatprovider.aspx"&gt;MSDN - IFormatProvider Interface&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.icustomformatter.aspx"&gt;MSDN - ICustomFormatter Interface&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&amp;nbsp; &lt;p&gt;&lt;strong&gt;*&lt;/strong&gt; I’m British, and I’m going to spell it properly! (My blog, my rules) &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-3339853861628336074?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/3339853861628336074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2011/02/localising-content-and-distances.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/3339853861628336074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/3339853861628336074'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2011/02/localising-content-and-distances.html' title='Localising Content and Distances'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_prPJEj560s4/TVG9WcC-HYI/AAAAAAAABPU/3SQ0YRxH2fA/s72-c/Solution1_thumb%5B8%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-7248068671859189019</id><published>2010-12-15T10:30:00.001Z</published><updated>2011-02-06T08:12:02.049Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gotchas'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.Net MVC'/><title type='text'>Building ASP.NET MVC Apps Gotcha</title><content type='html'>&lt;p&gt;When developing an ASP.NET MVC, you may run into this problem. You run the app and get a YSOD containing the following:&lt;/p&gt; &lt;h3&gt;&lt;span style="background-color: rgb(255, 0, 0);"&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;Server Error in '/' Application.&lt;/span&gt;  &lt;hr size="1" width="100%"&gt; &lt;/h3&gt; &lt;h4&gt;&lt;i&gt;&lt;span style="color:#c0504d;"&gt;Parser Error&lt;/span&gt;&lt;/i&gt;&lt;/h4&gt;&lt;b&gt;Description: &lt;/b&gt;An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
&lt;b&gt;Parser Error Message: &lt;/b&gt;Could not load type ‘&amp;lt;assembly name of your application&amp;gt;’.
&lt;b&gt;Source Error:&lt;/b&gt;  &lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style="background-color: rgb(255, 255, 0);" &gt;Line 1:  &amp;lt;%@ Application Codebehind="Global.asax.cs"
Inherits="assembly name of you application" Language="C#" %&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;Source File: &lt;/b&gt;/global.asax&lt;b&gt;    Line: &lt;/b&gt;1   &lt;/p&gt;&lt;p&gt;What caused this error for me was that I’d set the build output path of the app to “bin\debug”. By default, it is set to “bin”. Changing the output path back to “bin” resolved the issue.
&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_prPJEj560s4/TR2xMtcXKxI/AAAAAAAABOk/Ws6r4UXVUqI/s1600-h/buildoutput%5B4%5D.png"&gt;&lt;img style="background-image: none; border-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px;" title="buildoutput" alt="buildoutput" src="http://lh6.ggpht.com/_prPJEj560s4/TR2xNJMs1nI/AAAAAAAABOo/fyn-qM-dM7Q/buildoutput_thumb%5B2%5D.png?imgmax=800" border="0" height="559" width="475" /&gt;&lt;/a&gt;
&lt;/p&gt;&lt;p&gt;I ran across this gotcha a couple of months ago and a colleague of mine ran into it also last week. I thought I’d blog about it, in case it trips more people up…&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-7248068671859189019?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/7248068671859189019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2010/12/building-aspnet-mvc-apps-gotcha.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/7248068671859189019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/7248068671859189019'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2010/12/building-aspnet-mvc-apps-gotcha.html' title='Building ASP.NET MVC Apps Gotcha'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_prPJEj560s4/TR2xNJMs1nI/AAAAAAAABOo/fyn-qM-dM7Q/s72-c/buildoutput_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-919053876764982805</id><published>2010-08-28T19:39:00.001+01:00</published><updated>2012-01-19T22:51:31.675Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>A Little Reflection Loveliness…</title><content type='html'>I was creating some test data recently for a class generated from a DBML file.The object would be saved to a test/development database. The object had a 20 or so string fields that couldn’t be left null could be set to empty, even though they were not needed for the test scenario the data was being created for.&lt;br /&gt;
&lt;br /&gt;
I had encountered this issue before and realising it may occur again, rather than deciding to set every field to empty by hand, I decided to come up with a way that I could create an object, set only the properties I needed for the test data to be valid then ensure all other properties were set to empty.&lt;br /&gt;
First let me try and put the issue into context with an example. Lets say we have a class defined as so:&lt;br /&gt;
&lt;pre class="brush: csharp; font-size: 65%;"&gt;    public class Person
    {
        public int    ID         { get; set; }
        public string Title      { get; set; }
        public string FirstName  { get; set; }
        public string LastName   { get; set; }
        public string MiddleName { get; set; }
        public string Address1   { get; set; }
        public string Address2   { get; set; }
        public string Address3   { get; set; }
        public string City       { get; set; }
        public string Postcode   { get; set; }
    }
&lt;/pre&gt;
and need to instantiate an instance for a test but only need the Title, FirstName, MiddleName and LastName properties assigning to with meaningful values, all other string values must be set to empty.&lt;br /&gt;
We could spin up an instance as so:&lt;br /&gt;
&lt;pre class="brush: csharp; font-size: 65%;"&gt;    
var Martin = new Person()
       {
        Title      = "Mr",
        FirstName  = "Martin",
        MiddleName = "Joseph",
        LastName   = "Evans",
        Address1   = String.Empty,
        Address2   = String.Empty,
        Address3   = String.Empty,
        City       = String.Empty,
        Postcode   = String.Empty
       };
&lt;/pre&gt;
Assigning an empty value to the unnecessary fields clutters the code and IMO makes it too verbose. What we can do however is use reflection to assign an empty value to the values that we don’t assign explicitly.&lt;br /&gt;
&lt;pre class="brush: csharp; font-size: 65%;"&gt;  
  var Martin = new Person()
                  {
                      Title = "Mr",
                      FirstName = "Martin",
                      MiddleName = "Joseph",
                      LastName = "Evans"
                  };

 // Get all string propeties that are currently null
 var props = typeof(Person).GetProperties()
     .Where(x =&amp;gt; x.PropertyType.Name == ("String")
                 &amp;amp;&amp;amp; x.GetValue(Martin, BindingFlags.Instance, null, null, null) == null)
     .ToList();



 // Iterate through all properties in the instance, setting the value to empty
 props.ForEach(x =&amp;gt;
               x.SetValue(Martin, String.Empty,
                          BindingFlags.Instance | BindingFlags.Public, null, null, null));
&lt;/pre&gt;
Taking the idea a little further, so it can be reused by any type, we can place the code in a method and make it generic, which can then be invoked on an instance of any type.&lt;br /&gt;
&lt;pre class="brush: csharp; font-size: 65%;"&gt;        private Person GetMartin()
        {
            var Martin = new Person()
                             {
                                 Title      = "Mr",
                                 FirstName  = "Martin",
                                 MiddleName = "Joseph",
                                 LastName   = "Evans",
                             };

            SetNullStringsToEmpty(Martin);

            return Martin;

        }

        private void SetNullStringsToEmpty&lt;t&gt;(T obj)
        {
            typeof(T).GetProperties()
            .Where(x =&amp;gt; x.PropertyType.Name.Equals("String")
                    &amp;amp;&amp;amp; x.GetSetMethod() != null
                    &amp;amp;&amp;amp; x.GetValue(obj, BindingFlags.Instance, null, null, null) == null)
            .ToList()
            .ForEach(x =&amp;gt; x.SetValue(obj, string.Empty, BindingFlags.Instance | BindingFlags.Public, null, null, null));
        }
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Update:&lt;/b&gt; I added the check for a GetSetMethod on the where clause to ensure that only the Properties with public setters are returned.&amp;nbsp; If a property does not have a setter, the GetSetMethod returns null. Were we to try to&amp;nbsp; assign a value to a property that has no setter, an argumentException will be thrown.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-919053876764982805?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/919053876764982805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2010/08/little-reflection-loveliness.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/919053876764982805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/919053876764982805'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2010/08/little-reflection-loveliness.html' title='A Little Reflection Loveliness…'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-354319958162084762</id><published>2010-08-05T17:42:00.001+01:00</published><updated>2010-08-05T17:42:04.524+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gotchas'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>Left Joins In LINQ</title><content type='html'>&lt;p&gt;This post describes how to carry out a Left Join type query using LINQ.The examples using LINQ-to-SQL.&lt;/p&gt; &lt;p&gt;I needed to do some data crunching the other day using LINQ and realised that a “LEFT JOIN” operator isn’t available. I’ve found a a number of workarounds to this issue that I’ll be discussing but first, lets step back and describe what a “left join“ actually is. Suppose we had a database containing two (very simplistic) tables containing Customer and Order information…&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_prPJEj560s4/TFrp0H4SZaI/AAAAAAAABNo/NP_hFsqFZVk/s1600-h/ERD%5B1%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="ERD" border="0" alt="ERD" src="http://lh6.ggpht.com/_prPJEj560s4/TFrp0tMx9bI/AAAAAAAABNs/6pS6qQHxOPU/ERD_thumb%5B1%5D.jpg?imgmax=800" width="488" height="147"&gt;&lt;/a&gt; …and we wanted to query the database for all customers and the orders they’d placed. If a customer hasn’t placed any orders, we still want to list the customers details but obviously, the order information will be null.&lt;/p&gt; &lt;p&gt;We can query the database using a SQL statement:&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt; &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; Customers.CustomerId&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;         ,Customers.Name,Customers.EMail&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;         ,Orders.OrderId,Orders.DatePlaced&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;         ,Orders.Shipped&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt;    Customers &lt;span style="color: #0000ff"&gt;LEFT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;OUTER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; Orders &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt;      Customers.CustomerId = Orders.CustomerId&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;… to return the following results:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_prPJEj560s4/TFrp1G7HXeI/AAAAAAAABNw/zV4Y-e_kHsg/s1600-h/SqlQueryResults%5B5%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="SqlQueryResults" border="0" alt="SqlQueryResults" src="http://lh4.ggpht.com/_prPJEj560s4/TFrp1xVqZcI/AAAAAAAABN0/nQCsJvSeUj0/SqlQueryResults_thumb%5B5%5D.jpg?imgmax=800" width="489" height="97"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As you can see, in our test data, Martin Evans has placed three orders but John Smith hasn’t placed any. Data is returned in this way because the LEFT JOIN operator is used to link data being selected from the Customer and Orders tables. In effect, our SQL query is asking the following:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Return all records from the Orders table with its corresponding record from the Customer table. If the CustomerId field in the Customer table matches the CustomerId field in the Orders table treat them as a corresponding records. BTW, if you can’t find any corresponding orders for a customer, just return the customer details”.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;If we just wanted to return Customer records with corresponding records only, we’d use an INNER JOIN rather than a LEFT JOIN&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; Customers.CustomerId&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;         ,Customers.Name,Customers.EMail&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;         ,Orders.OrderId,Orders.DatePlaced&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;         ,Orders.Shipped&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt;    Customers &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; Orders &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt;        Customers.CustomerId = Orders.CustomerId&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;using the same test data, this would only return the following:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_prPJEj560s4/TFrp2SRiEkI/AAAAAAAABN4/VWrvEEjfTdU/s1600-h/SqlQueryResults2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="SqlQueryResults2" border="0" alt="SqlQueryResults2" src="http://lh3.ggpht.com/_prPJEj560s4/TFrp24sR_bI/AAAAAAAABN8/-gx4_J4gjcQ/SqlQueryResults2_thumb.jpg?imgmax=800" width="501" height="81"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;As I mentioned before, LINQ doesn’t have a LEFT JOIN operator so to emulate this functionality, I’ve found two workarounds:&lt;/p&gt;
&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; var CustomersAndOrders = &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;     from co &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; ctx.Customers.GroupJoin(&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     ctx.Orders,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     customer =&amp;gt; customer.CustomerId,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     orders =&amp;gt; orders.CustomerId,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     (customer, orders) =&amp;gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; { customer, orders })&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     select co;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This code above uses the LINQ &lt;a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable.groupjoin.aspx" target="_blank"&gt;GROUPJOIN&lt;/a&gt; operator to retrieve a customer and their corresponding orders. In this instance, for each customer record, an anonymous type is returned, containing a customer object and a enumerable collection of orders. This allows us to access the data in this manner…&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; CustomersAndOrders.ToList().ForEach(c =&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;   {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;    Console.Write(&lt;span style="color: #006080"&gt;"{0}\n"&lt;/span&gt;, c.customer.Name);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (c.orders.Count() == 0) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;        Console.Write(&lt;span style="color: #006080"&gt;"\t: No Orders Placed\n"&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;    } &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     c.orders.ToList().ForEach(o =&amp;gt; Console.Write(&lt;span style="color: #006080"&gt;"\t: {0}\n"&lt;/span&gt;, o.OrderId));&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;    });&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;…producing the following output:&lt;/p&gt;
&lt;div id="codeSnippetWrapper"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;Martin Evans        &lt;br&gt;    : 1&lt;br&gt;    : 2&lt;br&gt;    : 3&lt;br&gt;John Smith&lt;br&gt;    : No Orders Placed&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;
&lt;p&gt;The SQL statement that was sent to the server was as follows&lt;/p&gt;
&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; [t0].[CustomerId], [t0].[Name], [t0].[EMail], &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;     [t1].[OrderId], [t1].[CustomerId] &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [CustomerId2], &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     [t1].[DatePlaced], [t1].[Shipped], &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     (&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;COUNT&lt;/span&gt;(*)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;      &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; [dbo].[Orders] &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [t2]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;      &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; [t0].[CustomerId] = [t2].[CustomerId]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;      ) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;value&lt;/span&gt;]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; [dbo].[Customers] &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [t0]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;LEFT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;OUTER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; [dbo].[Orders] &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [t1] &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; [t0].[CustomerId] = [t1].[CustomerId]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ORDER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; [t0].[CustomerId], [t1].[OrderId]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Notice the sub query called to count the orders for each customer – an unexpected piece of overhead that may be worth remembering!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The second option is shown below.&lt;/p&gt;
&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; var customersAndOrders = &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;     from customer &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; ctx.Customers&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;         from order &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; ctx.Orders&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;         .Where(o =&amp;gt; o.CustomerId == customer.CustomerId).DefaultIfEmpty()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     select &lt;span style="color: #0000ff"&gt;new&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     {customer,order};&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This returns a flattened result set, mapping one order to one customer in a similar manner to the LEFTJOIN SQL example shown earlier. The result-set can be accessed as so:&lt;/p&gt;
&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; customersAndOrders.ToList().ForEach(c =&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;  {Console.Write(&lt;span style="color: #006080"&gt;"{0} "&lt;/span&gt;, c.customer.Name);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (c.order == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;){&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;   Console.Write(&lt;span style="color: #006080"&gt;": No Orders Placed\n"&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;  } &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;   Console.Write(&lt;span style="color: #006080"&gt;": {0}\n"&lt;/span&gt;, c.order.OrderId);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;  }});&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;..resulting in the following output:&lt;/p&gt;
&lt;div&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;Martin Evans : 1&lt;br&gt;Martin Evans : 2&lt;br&gt;Martin Evans : 3&lt;br&gt;John Smith : No Orders Placed&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;The SQL statement executed at the statement this time however is much more what we’d expect:&lt;/div&gt;
&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; [t0].[CustomerId], [t0].[Name], &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; [t0].[EMail], [t2].[test], &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; [t2].[OrderId], [t2].[CustomerId] &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [CustomerId2],&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; [t2].[DatePlaced], [t2].[Shipped]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; [dbo].[Customers] &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [t0]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;LEFT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;OUTER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; (&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; 1 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [test], [t1].[OrderId], &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     [t1].[CustomerId], [t1].[DatePlaced], [t1].[Shipped]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; [dbo].[Orders] &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [t1]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     ) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [t2] &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; [t2].[CustomerId] = [t0].[CustomerId]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;br&gt;This matches our original left join query a lot more closely. I think the test column is used by LINQ to check for the existence of a corresponding joined record. In this case, an orders record.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;I think each method has its merits but the sub-query created using the GroupJoin operator may be worth remembering if you’re querying for a high volume of records as it may generate a little more overhead than you expect….&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-354319958162084762?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/354319958162084762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2010/08/left-joins-in-linq.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/354319958162084762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/354319958162084762'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2010/08/left-joins-in-linq.html' title='Left Joins In LINQ'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_prPJEj560s4/TFrp0tMx9bI/AAAAAAAABNs/6pS6qQHxOPU/s72-c/ERD_thumb%5B1%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-4541547720905471799</id><published>2010-07-12T22:40:00.001+01:00</published><updated>2010-07-12T22:40:48.415+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WINDOWS 7'/><category scheme='http://www.blogger.com/atom/ns#' term='Gotchas'/><category scheme='http://www.blogger.com/atom/ns#' term='VS2008'/><title type='text'>“To access local IIS Web sites, you must install the following IIS components:”</title><content type='html'>&lt;p&gt;I was running a new development environment consisting of a Windows 7 32 bit box with Visual Studio 2008 solution containing a number of class libraries and a website located on my local IIS 7.0 instance.&amp;nbsp; &lt;/p&gt; &lt;p&gt;On spinning the Visual Studio solution up this morning, the following error message was displayed:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;"To access local IIS Web sites, you must install the following IIS components:&lt;/p&gt; &lt;p&gt;&lt;br&gt;In addition, you must run Visual Studio in the context of an administrator account."&lt;br&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Hmmm. there’s something wrong with this picture… mainly the non-existent list of components! Further to this, I &lt;strong&gt;was&lt;/strong&gt; running the application as the Administrator!&lt;/p&gt; &lt;p&gt;I found a number of suggestions regarding the switching of the IIS6 Management and Compatibility items in IIS7.0 then switching it back on again after a reboot.I tried that but the fault still presented itself. &lt;/p&gt; &lt;p&gt;The work around I found was to turn off IIS completely by carrying out the following: &lt;/p&gt; &lt;ol&gt; &lt;li&gt;Select “Start &amp;gt; Control Panel &amp;gt; Programs and Features &amp;gt; Turn Windows features on or off”  &lt;li&gt;Ensure all items under Internet Information Services are deselected.  &lt;li&gt;Select OK&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;You’ll probably be prompted to restart your machine. After rebooting, turn IIS back on by following step 1 above again, then reselect the items under Internet Information Services you previously deselected. You shouldn’t need to restart this time, just fire up Visual Studio and you’ll hopefully be able to load your IIS project again. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-4541547720905471799?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/4541547720905471799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2010/07/to-access-local-iis-web-sites-you-must.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/4541547720905471799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/4541547720905471799'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2010/07/to-access-local-iis-web-sites-you-must.html' title='“To access local IIS Web sites, you must install the following IIS components:”'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-6938218914803674110</id><published>2010-06-03T15:26:00.001+01:00</published><updated>2010-06-03T15:55:31.922+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Working Practices'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Onwards And Upwards</title><content type='html'>&lt;p&gt;I’ve been a bit quiet for that last couple of weeks as I’ve been in the process of applying for a new job. After 2 years at Harper Adams University College, I’ve regrettably decided to move on. I’ve really enjoyed working on campus albeit on the fringes. The students make this place. They are the college. They inject all the energy into the place, as well as the occasional high-jinx driven destruction!&lt;/p&gt;  &lt;p&gt;I was secretly yearning to get back into a feature-driven development team environment but although I wasn’t actively looking but I got a call via &lt;a title="Martin Evans on Linked In" href="http://uk.linkedin.com/in/martinjosephevans"&gt;Linked-In&lt;/a&gt; from an old buddy of mine. I knew him socially but neither of us new that we were both developers. His firm was recruiting .NET developers, and after a night in our local pub discussing the role, I speculatively e-mailed my CV.&lt;/p&gt;  &lt;p&gt;The rest as they say, is history. After two interviews including a technical test, I start at my new firm next month and can’t wait. Did I mention that I’d be working from home? Right up my street…literally!&lt;/p&gt;  &lt;p&gt;I’m a strong believer in drawing positives from any situation and there are more than enough positives and strengths that I’m leaving this role with.&amp;#160; My ability to construct a sentence with a high acronym factor has increase ten-fold having gained a wider appreciation of CI, SVN, TDD, IOC and DI!&amp;#160; I also spend more time thinking about what design pattern could fit a problem now, rather than just spinning any old solution up. I can only hope that this will assist my replacement :-)&lt;/p&gt;  &lt;p&gt;The most important thing I’ve come to realise is the value of face-to-face time with the customer and the fact that that nothing helps you scope out what the customer wants’ more than a picture.&amp;#160; I released the last bit of functionality I’ll produce into &lt;a title="Knowledge Transfer in the Agricultural sector" href="http://www.openfields.org.uk/"&gt;OpenFields&lt;/a&gt; the other day. Prior to merging the feature branch into the trunk&amp;#160; and doing a live release, I got the stake holders in front of a screen and went through the completed feature with them. We’d “work shopped” this feature last week using &lt;a href="http://www.balsamiq.com/products/mockups"&gt;Balsamiq Mockups&lt;/a&gt; so it was a bit of an anti-climax really, given that they saw exactly what they’d expected to see. No surprises. No Pain. Just a verbal acknowledgement that what they could see matched their requirements. 10 minutes later, the branch was merged and the feature was live. Cushty! Face to face time is like gold dust if everyone engages in it. &lt;/p&gt;  &lt;p&gt;I’ll probably crawl back into my hole for a bit while I settle into my new job. I’m going to start playing with Mercurial and EF in the meantime so might &lt;a href="http://twitter.com/martin_evans"&gt;tweet&lt;/a&gt; some stupid questions looking for some guidance in the meantime and if I stumble on any links for successful home working, Ill tweet them also.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-6938218914803674110?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/6938218914803674110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2010/06/onwards-and-upwards.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/6938218914803674110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/6938218914803674110'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2010/06/onwards-and-upwards.html' title='Onwards And Upwards'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-6312347594545394381</id><published>2010-05-06T10:35:00.001+01:00</published><updated>2010-05-06T10:36:11.585+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Software Design'/><title type='text'>Selecting Random Values from a Generic List</title><content type='html'>&lt;p&gt;I recently ran into a scenario where I had to randomly select a specific number of objects from another list . I wrote a function that returned a list of concrete types then realised that this could be made generic.&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; List&amp;lt;T&amp;gt; RandomSelectionOfItems&amp;lt;T&amp;gt;(List&amp;lt;T&amp;gt; list, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; numberToReturn)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;       {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;           &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (list.Count &amp;lt; numberToReturn)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;           {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;               &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; list;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;           }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;           var ret = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; List&amp;lt;T&amp;gt;();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;           var items = list.ToArray();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;           var rnd = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Random(0);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;           var maxValue = items.Length - 1;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;           var register = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; List&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt;();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;           &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 0; i &amp;lt;= numberToReturn; i++)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;           {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;               var index = rnd.Next(maxValue);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;               &lt;span style="color: #008000"&gt;// Hold the used values in a register &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;               &lt;span style="color: #008000"&gt;// in case they're selected again&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;               &lt;span style="color: #0000ff"&gt;while&lt;/span&gt; (!register.Contains(index))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;               {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                   ret.Add(items[index]);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                   register.Add(index);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;               }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;           }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;           &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; ret;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;       }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Sadly, this is the most interesting code I’ve written as of late so thought I’d better put it somewhere. It was either here or my fridge door…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-6312347594545394381?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/6312347594545394381/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2010/05/selecting-random-valuies-from-generic.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/6312347594545394381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/6312347594545394381'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2010/05/selecting-random-valuies-from-generic.html' title='Selecting Random Values from a Generic List'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-9031847934050461794</id><published>2010-03-07T21:44:00.001Z</published><updated>2010-03-07T21:54:46.467Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gotchas'/><title type='text'>Blogger Bugs and Quirks</title><content type='html'>&lt;p&gt;Blogger currently has a &lt;a href="http://www.google.com/support/forum/p/blogger/thread?tid=6c9058ddb2338eb5&amp;amp;hl=en" target="_blank"&gt;fault that seems to affect IE8, FF3.6 and Chrome 4.0&lt;/a&gt;. In fact, there are a couple of things that just don’t seem to work&amp;#160; “out of the box” at the moment and need to be hacked to get some level of usable functionality:&lt;/p&gt;  &lt;h2&gt;Access Denied Error&amp;#160; - http://www.blogger.com/static/v1/widgets/185422768-widgets.js&lt;/h2&gt;  &lt;p&gt;This causes all kinds of mayhem in IE8, FF 3.6 and Chrome 4. The workaround while the fix is being figured out is to add the following to the head section of your blogger template.&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &amp;lt;script type=&lt;span style="color: #006080"&gt;'text/javascript'&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;     window.onerror = &lt;span style="color: #0000ff"&gt;function&lt;/span&gt;() { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;; } &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;&amp;#160;&lt;/h2&gt;

&lt;h2&gt;Blogger Comments captcha verification not being displayed&lt;/h2&gt;

&lt;p&gt;Add the following line into the templates style sheet to enable the captcha panel to be displayed.&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; #comment-editor {height:450px;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Hope this helps….&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-9031847934050461794?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/9031847934050461794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2010/03/bugs-and-stuff.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/9031847934050461794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/9031847934050461794'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2010/03/bugs-and-stuff.html' title='Blogger Bugs and Quirks'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-3568320743431763241</id><published>2010-03-06T16:21:00.000Z</published><updated>2010-03-07T20:12:11.338Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Working Practices'/><category scheme='http://www.blogger.com/atom/ns#' term='Software Design'/><title type='text'>Do You Seek Permission or Forgiveness?</title><content type='html'>&lt;p&gt;I attended a python dojo at dev8D last week and a conversation ensued regarding type checking within a function. As python is loosely typed and dynamic, any object could be passed into pretty much any function. A question was asked about whether a function should check for the type it was going to use prior to actually using it. It was not deemed to be “Pythonic” to check the types but rather to ensure adequate exception handling is in place in case of,well…. an exception!&lt;/p&gt;  &lt;p&gt;I thought about this for a while and wondered if this notion could be applied to my own programming. Consider the following method:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; DisplayNameAndTitle(Person p) &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;          Console.WriteLine(&lt;span style="color: #006080"&gt;&amp;quot;{0} {1} {2}&amp;quot;&lt;/span&gt;, p.Title, p.GivenName, p.FamilyName);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Obviously, all we’re doing here is writing out to the console the title, first and surname of an imaginary person object. Our method only contains the essence of what we want the method to do and it would be great if that was all it had to contain but we have to think and code a little more defensively than that! So what could possibly go wrong in our little example that means we’ve got to consider adding more code to our method?&amp;#160; Our main concern should be that the person object doesn’t actually equate to anything, so maybe we should check it exists before we try to use it:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; DisplayNameAndTitle(Person p) &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;       {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;           &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (p != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;           {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;               Console.WriteLine(&lt;span style="color: #006080"&gt;&amp;quot;{0} {1} {2}&amp;quot;&lt;/span&gt;, p.Title, p.GivenName, p.FamilyName);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;           }          &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;       }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;By carrying out a null check on the person object before using it, we’re almost seeking permission before we use it. We’re certainly placing ceremonial code before the essence. This seems a bit smelly if you ask me. We’re checking for a null value every time the method runs, adding processing overhead to the method even when everything’s “peachy”. &lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; DisplayNameAndTitle(Person p)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;        &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;            Console.WriteLine(&lt;span style="color: #006080"&gt;&amp;quot;{0} {1} {2}&amp;quot;&lt;/span&gt;, p.Title, p.GivenName, p.FamilyName);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;        &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (NullReferenceException)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;            &lt;span style="color: #008000"&gt;// runs when the Person object, or one of its properties is null&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;        &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;            &lt;span style="color: #008000"&gt;// runs when any other exception occurs&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;            &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;By using a try/catch statement, we can let the essence run with sooner, but seek forgiveness&amp;#160; and run the “ceremonial code” only runs when something goes wrong. &lt;/p&gt;

&lt;p&gt; Although the examples in this post have centred around dealing with null references, any scenario could have been used. &lt;/p&gt;

&lt;p&gt; I didn’t really have a strong view regarding this matter but having thought it through, I’m going seek forgiveness from now on and hopefully will be able to produce some even more “concise essence”, with an apology always on stand-by…!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-3568320743431763241?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/3568320743431763241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2010/03/should-you-seek-permission-or.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/3568320743431763241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/3568320743431763241'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2010/03/should-you-seek-permission-or.html' title='Do You Seek Permission or Forgiveness?'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-7764275918127450643</id><published>2010-03-02T21:23:00.001Z</published><updated>2010-03-07T20:13:40.417Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='dev8D'/><category scheme='http://www.blogger.com/atom/ns#' term='Zentity'/><title type='text'>Mashing Up Zentity</title><content type='html'>&lt;p&gt;&lt;a style="float: right" href="http://lh3.ggpht.com/_prPJEj560s4/S4_pURSSYSI/AAAAAAAABMw/fFQO61ra7Tc/s1600-h/ZentityHome%5B1%5D%5B5%5D.jpg"&gt;&lt;img style="display: inline; margin-left: 0px; margin-right: 0px" title="ZentityHome" alt="ZentityHome" align="right" src="http://lh4.ggpht.com/_prPJEj560s4/S4_pVYrPJzI/AAAAAAAABM0/C7uj2m9rWuE/ZentityHome%5B1%5D_thumb%5B3%5D.jpg?imgmax=800" width="240" height="153" /&gt;&lt;/a&gt; One of the bounty challenges set at &lt;a title="Developer Happines" href="http://dev8d.org/" target="_blank"&gt;dev8D&lt;/a&gt; was set by Microsoft to extend its research repository platform, &lt;a title="zentity research repository" href="http://research.microsoft.com/en-us/projects/zentity/" target="_blank"&gt;Zentity&lt;/a&gt; provide new ways of visualising the data held within it. I’ve been working on the &lt;a title="An agricultural sector repository to support research into practice" href="http://www.openfields.org.uk/" target="_blank"&gt;OpenFields Project&lt;/a&gt; for over a year now which is an open access repository project but although I’m a .Net developer, I had never really heard about Zentity until dev8D.&lt;/p&gt;  &lt;p&gt; The platform is written in .NET and leverages the Entity Framework. Using SQL Server 2008&amp;#160; as its backing store, it has a web UI out of the box and content can be aggregated using RSS, OAI-PMH, OAI-ORE, AtomPub and &lt;a title="a lightweight protocol for depositing content from one location to another" href="http://www.swordapp.org/" target="_blank"&gt;SWORD&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt; During the lab session at dev8D, &lt;a title="Steves Blog" href="http://stevenjohnston.co.uk/" target="_blank"&gt;Steve Johnston&lt;/a&gt; and Mark Scott showed us how easily content could be added via PowerShell scriptlets (note to self – &lt;strong&gt;must&lt;/strong&gt; grok up on Power Shell!). After the session and with a little help from &lt;a title="gokulives blog" href="http://blog.gokulives.com/" target="_blank"&gt;Kieran Marron&lt;/a&gt; I had a test database with an abundance of content, a development environment and 18 hours in which to submit an entry for the bounty challenge!!&lt;/p&gt;  &lt;h3&gt;The Plan&lt;/h3&gt;  &lt;p&gt;I decided to explore the concept of a RESTful front end to a Zentity instance, returning entities from the Scholarly namespace as JSON objects, the idea being that other systems could do GET requests for the data held in the repository. Using ASP.Net MVC for this was a “no brainer” really as I could utilise the JsonResult object so all I had to do was get an object out of the repository architecture and into one of my controller methods. &lt;/p&gt;  &lt;p&gt;I decided to create a service for searching for a contributor by name, then drilling down via the contributors id to see the work they have stored in the repository. The other benefit to using ASP.Net MVC for this, is of course, is that the clean url generation of the MVC framework will make it easy for a potential user of the service to understand what they were getting:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_prPJEj560s4/S4_pWYCtKJI/AAAAAAAABM4/9WyIK6JlztE/s1600-h/URISchema%5B4%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="URISchema" border="0" alt="URISchema" src="http://lh4.ggpht.com/_prPJEj560s4/S4_pXbAb5aI/AAAAAAAABM8/KOj3V7QPCOA/URISchema_thumb%5B2%5D.jpg?imgmax=800" width="538" height="408" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To prove/disprove the concept, and in between sleeping for four hours, eating moderately and drinking heavily, I built the service and a web page that called the controller methods using a little JQuery and ajax loveliness. I had to keep things lean so only implemented the Search and AllWorks controller methods but I think it will help you see where I was going with it&lt;/p&gt;  &lt;h3&gt;Disclaimer&lt;/h3&gt;  &lt;p&gt;Don’t flame me for the code quality, it was just to prove a concept – no edge cases or cohesion were considered in the creation of this demo!&lt;/p&gt;  &lt;p&gt; Here’s the Person Controller:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web.Mvc;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web.Mvc.Ajax;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; WebApp.Controllers&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; PersonController : Controller&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// /person/search&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;         [AcceptVerbs(HttpVerbs.Get)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; JsonResult Search(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; searchVal)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (ZentityRepository rep = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ZentityRepository())&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;                 var d = rep.FindByName(searchVal);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; Json(d);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// /person/allworks/personid&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;         [AcceptVerbs(HttpVerbs.Get)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; JsonResult AllWorks(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; id)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (ZentityRepository rep = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ZentityRepository())&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum28"&gt;  28:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum29"&gt;  29:&lt;/span&gt;                 var d = rep.GetAllWorks(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Guid(id));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum30"&gt;  30:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum31"&gt;  31:&lt;/span&gt;                 &lt;span style="color: #008000"&gt;// ran into circular dependancy issues,&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum32"&gt;  32:&lt;/span&gt;                 &lt;span style="color: #008000"&gt;// parsing a list of Scholarly Work so &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum33"&gt;  33:&lt;/span&gt;                 &lt;span style="color: #008000"&gt;// I'm returning an annonymous type in this case,&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum34"&gt;  34:&lt;/span&gt;                 &lt;span style="color: #008000"&gt;// cherry picking the items to display&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum35"&gt;  35:&lt;/span&gt;                 var ret = from works &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; d&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum36"&gt;  36:&lt;/span&gt;                           select &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; { works.Title, works.Description };&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum37"&gt;  37:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; Json(ret);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum38"&gt;  38:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum39"&gt;  39:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum40"&gt;  40:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum41"&gt;  41:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Here’s the wrapper object I put round the calls to Zentity, ZentityRepository:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Zentity.ScholarlyWorks;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Zentity.Core;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; WebApp&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; ZentityRepository : IDisposable&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// Hard wired for the benefit of the demo. &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// Do not flame me for this!!&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; connStr = &lt;span style="color: #006080"&gt;@&amp;quot;provider=System.Data.SqlClient;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;                 metadata=res://Zentity.ScholarlyWorks;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;                 provider connection string='Data Source=WIN7DEV\SQLEXPRESS;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;                 Initial Catalog=Zentity;Integrated Security=True;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;                 MultipleActiveResultSets=True'&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; ZentityContext C;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ZentityRepository()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt;             C = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ZentityContext(connStr);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum28"&gt;  28:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum29"&gt;  29:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum30"&gt;  30:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// Used to search for a person that has a first or family&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum31"&gt;  31:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// name starting with the param string passed in.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum32"&gt;  32:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum33"&gt;  33:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;param&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum34"&gt;  34:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum35"&gt;  35:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; List&amp;lt;Person&amp;gt; FindByName(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; param)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum36"&gt;  36:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum37"&gt;  37:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; C.People().Where(p =&amp;gt; (p.FirstName.StartsWith(param) || p.LastName.StartsWith(param))).ToList();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum38"&gt;  38:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum39"&gt;  39:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum40"&gt;  40:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum41"&gt;  41:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// To prove the concept, lets mash all the works together,&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum42"&gt;  42:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// for a good return in the demo.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum43"&gt;  43:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum44"&gt;  44:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;id&amp;quot;&amp;gt;Id of the person to get the works for&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum45"&gt;  45:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt; &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum46"&gt;  46:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; List&amp;lt;ScholarlyWork&amp;gt; GetAllWorks(Guid id)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum47"&gt;  47:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum48"&gt;  48:&lt;/span&gt;             var p = C.People().Where(person =&amp;gt; (person.Id == id)).FirstOrDefault();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum49"&gt;  49:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum50"&gt;  50:&lt;/span&gt;             &lt;span style="color: #008000"&gt;/// Get all the works items attached&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum51"&gt;  51:&lt;/span&gt;             &lt;span style="color: #008000"&gt;/// to a person entity&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum52"&gt;  52:&lt;/span&gt;             p.ContributionInWorks.Load();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum53"&gt;  53:&lt;/span&gt;             p.AuthoredWorks.Load();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum54"&gt;  54:&lt;/span&gt;             p.EditedWorks.Load();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum55"&gt;  55:&lt;/span&gt;             p.PresentedWorks.Load();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum56"&gt;  56:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum57"&gt;  57:&lt;/span&gt;             &lt;span style="color: #008000"&gt;/// Put them all in a single list object to return&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum58"&gt;  58:&lt;/span&gt;             var ret = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; List&amp;lt;ScholarlyWork&amp;gt;();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum59"&gt;  59:&lt;/span&gt;             ret.AddRange(p.ContributionInWorks);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum60"&gt;  60:&lt;/span&gt;             ret.AddRange(p.AuthoredWorks);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum61"&gt;  61:&lt;/span&gt;             ret.AddRange(p.EditedWorks);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum62"&gt;  62:&lt;/span&gt;             ret.AddRange(p.PresentedWorks);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum63"&gt;  63:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum64"&gt;  64:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; ret;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum65"&gt;  65:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum66"&gt;  66:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum67"&gt;  67:&lt;/span&gt;         &lt;span style="color: #cc6633"&gt;#region&lt;/span&gt; IDisposable Members&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum68"&gt;  68:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum69"&gt;  69:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Dispose()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum70"&gt;  70:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum71"&gt;  71:&lt;/span&gt;             C.Dispose();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum72"&gt;  72:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum73"&gt;  73:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum74"&gt;  74:&lt;/span&gt;         &lt;span style="color: #cc6633"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum75"&gt;  75:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum76"&gt;  76:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Finally, here’s the front end of the demo:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="background-color: #ffff00"&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; Inherits=&amp;quot;System.Web.Mvc.ViewPage&amp;quot; %&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color: #800000"&gt;DOCTYPE&lt;/span&gt; &lt;span style="color: #ff0000"&gt;html&lt;/span&gt; &lt;span style="color: #ff0000"&gt;PUBLIC&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Head1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Home&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;link&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;text/css&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;rel&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Stylesheet&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;href&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;/styles/Site.css&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;/Scripts/jquery-1.3.2.min.js&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;     &amp;lt;script type=&lt;span style="color: #006080"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;         $(document).ready(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt;() {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;             $(&lt;span style="color: #006080"&gt;&amp;quot;#txtName&amp;quot;&lt;/span&gt;).bind(&lt;span style="color: #006080"&gt;&amp;quot;keydown&amp;quot;&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;function&lt;/span&gt;(e) { &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (e.keyCode == 13) DoSearch(); })&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;             $(&lt;span style="color: #006080"&gt;&amp;quot;#btnSearch&amp;quot;&lt;/span&gt;).bind(&lt;span style="color: #006080"&gt;&amp;quot;click&amp;quot;&lt;/span&gt;, DoSearch);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;         });&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// Person fields to pull out of the JSON data for parsing&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; PersonFields = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Array(&lt;span style="color: #006080"&gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;LastName&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Email&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Id&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; DoSearch() {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; searchVal = $(&lt;span style="color: #006080"&gt;&amp;quot;#txtName&amp;quot;&lt;/span&gt;).val();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;             $.ajax({&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;                 type: &lt;span style="color: #006080"&gt;&amp;quot;GET&amp;quot;&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;                 url: &lt;span style="color: #006080"&gt;&amp;quot;/PERSON/SEARCH&amp;quot;&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;                 dataType: &lt;span style="color: #006080"&gt;&amp;quot;json&amp;quot;&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;                 data: &lt;span style="color: #006080"&gt;&amp;quot;searchVal=&amp;quot;&lt;/span&gt; + searchVal,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;                 success: DisplayPersonResults&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;             });&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;         }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; GetScholarlyData(id) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; _url = &lt;span style="color: #006080"&gt;&amp;quot;/person/AllWorks/&amp;quot;&lt;/span&gt; + id;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;             DisplayUrl(_url);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt;             $.ajax({&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum28"&gt;  28:&lt;/span&gt;                 type: &lt;span style="color: #006080"&gt;&amp;quot;GET&amp;quot;&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum29"&gt;  29:&lt;/span&gt;                 url: _url,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum30"&gt;  30:&lt;/span&gt;                 dataType: &lt;span style="color: #006080"&gt;&amp;quot;json&amp;quot;&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum31"&gt;  31:&lt;/span&gt;                 data: &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum32"&gt;  32:&lt;/span&gt;                 success: DisplayScholarlyResults&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum33"&gt;  33:&lt;/span&gt;             });&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum34"&gt;  34:&lt;/span&gt;         }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum35"&gt;  35:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum36"&gt;  36:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; DisplayUrl(u) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum37"&gt;  37:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; s = &lt;span style="color: #006080"&gt;&amp;quot;Url used: &amp;lt;a href='&amp;quot;&lt;/span&gt; + u + &lt;span style="color: #006080"&gt;&amp;quot;'&amp;gt;&amp;quot;&lt;/span&gt; + u + &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;/a&amp;gt;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum38"&gt;  38:&lt;/span&gt;             $(&lt;span style="color: #006080"&gt;&amp;quot;#urlUsed&amp;quot;&lt;/span&gt;).html(s);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum39"&gt;  39:&lt;/span&gt;         }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum40"&gt;  40:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum41"&gt;  41:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; DisplayScholarlyResults(json) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum42"&gt;  42:&lt;/span&gt;             $(&lt;span style="color: #006080"&gt;&amp;quot;.summary&amp;quot;&lt;/span&gt;).remove();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum43"&gt;  43:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; json.length; i++) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum44"&gt;  44:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; str = &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;div class='summary'&amp;gt;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum45"&gt;  45:&lt;/span&gt;                 str += &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;h3&amp;gt;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum46"&gt;  46:&lt;/span&gt;                 str += json[i][&lt;span style="color: #006080"&gt;&amp;quot;Title&amp;quot;&lt;/span&gt;];&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum47"&gt;  47:&lt;/span&gt;                 str += &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;/h3&amp;gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum48"&gt;  48:&lt;/span&gt;                 str += &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;p&amp;gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum49"&gt;  49:&lt;/span&gt;                 str += json[i][&lt;span style="color: #006080"&gt;&amp;quot;Description&amp;quot;&lt;/span&gt;];&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum50"&gt;  50:&lt;/span&gt;                 str += &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;/p&amp;gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum51"&gt;  51:&lt;/span&gt;                 str += &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;/div&amp;gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum52"&gt;  52:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum53"&gt;  53:&lt;/span&gt;                 $(str).appendTo(&lt;span style="color: #006080"&gt;&amp;quot;#Works&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum54"&gt;  54:&lt;/span&gt;                 $(&lt;span style="color: #006080"&gt;&amp;quot;.summary:even&amp;quot;&lt;/span&gt;).css(&lt;span style="color: #006080"&gt;&amp;quot;background-color&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;#eeeeee&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum55"&gt;  55:&lt;/span&gt;             }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum56"&gt;  56:&lt;/span&gt;         }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum57"&gt;  57:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum58"&gt;  58:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// Data transformer that enables us to &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum59"&gt;  59:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// return the first and last name together and removes &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum60"&gt;  60:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// the other json objects as they're not needed for this view.&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum61"&gt;  61:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; dtoPersonView(columns, json) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum62"&gt;  62:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum63"&gt;  63:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; jsonOut = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Array();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum64"&gt;  64:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum65"&gt;  65:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; json.length; i++) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum66"&gt;  66:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; person = json[i];&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum67"&gt;  67:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum68"&gt;  68:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; tPerson = {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum69"&gt;  69:&lt;/span&gt;                     &lt;span style="color: #006080"&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;: person[&lt;span style="color: #006080"&gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;] + &lt;span style="color: #006080"&gt;' '&lt;/span&gt; + person[&lt;span style="color: #006080"&gt;&amp;quot;LastName&amp;quot;&lt;/span&gt;],&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum70"&gt;  70:&lt;/span&gt;                     &lt;span style="color: #006080"&gt;&amp;quot;E-Mail&amp;quot;&lt;/span&gt;: person[&lt;span style="color: #006080"&gt;&amp;quot;Email&amp;quot;&lt;/span&gt;],&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum71"&gt;  71:&lt;/span&gt;                     &lt;span style="color: #006080"&gt;&amp;quot;Id&amp;quot;&lt;/span&gt;: person[&lt;span style="color: #006080"&gt;&amp;quot;Id&amp;quot;&lt;/span&gt;]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum72"&gt;  72:&lt;/span&gt;                 };&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum73"&gt;  73:&lt;/span&gt;                 jsonOut.push(tPerson);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum74"&gt;  74:&lt;/span&gt;             }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum75"&gt;  75:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum76"&gt;  76:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; columnsOut = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Array(&lt;span style="color: #006080"&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Email&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Id&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum77"&gt;  77:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Array(columnsOut, jsonOut);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum78"&gt;  78:&lt;/span&gt;         }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum79"&gt;  79:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum80"&gt;  80:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; DisplayPersonResults(json) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum81"&gt;  81:&lt;/span&gt;             DisplayResultsAsList(dtoPersonView(PersonFields, json));&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum82"&gt;  82:&lt;/span&gt;             AttachDrillDownToNamesList();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum83"&gt;  83:&lt;/span&gt;         }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum84"&gt;  84:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum85"&gt;  85:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; AttachDrillDownToNamesList() {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum86"&gt;  86:&lt;/span&gt;             $(&lt;span style="color: #006080"&gt;&amp;quot;a.active_person&amp;quot;&lt;/span&gt;).each(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt;() {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum87"&gt;  87:&lt;/span&gt;                 $(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;).bind(&lt;span style="color: #006080"&gt;&amp;quot;click&amp;quot;&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;function&lt;/span&gt;() {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum88"&gt;  88:&lt;/span&gt;                     $(&lt;span style="color: #006080"&gt;&amp;quot;.selected&amp;quot;&lt;/span&gt;).removeClass(&lt;span style="color: #006080"&gt;'selected'&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum89"&gt;  89:&lt;/span&gt;                     $(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;).addClass(&lt;span style="color: #006080"&gt;'selected'&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum90"&gt;  90:&lt;/span&gt;                     GetScholarlyData($(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;).attr(&lt;span style="color: #006080"&gt;&amp;quot;id&amp;quot;&lt;/span&gt;))&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum91"&gt;  91:&lt;/span&gt;                 });&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum92"&gt;  92:&lt;/span&gt;             });&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum93"&gt;  93:&lt;/span&gt;         }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum94"&gt;  94:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum95"&gt;  95:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; DisplayResultsAsList(args) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum96"&gt;  96:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; columns = args[0];&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum97"&gt;  97:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; json = args[1];&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum98"&gt;  98:&lt;/span&gt;             $(&lt;span style="color: #006080"&gt;&amp;quot;#Names&amp;quot;&lt;/span&gt;).html(&lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;ul id='names_list'&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;&lt;/span&gt;).fadeIn(&lt;span style="color: #006080"&gt;&amp;quot;fast&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum99"&gt;  99:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum100"&gt; 100:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; json.length; i++) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum101"&gt; 101:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; person = json[i];&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum102"&gt; 102:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; rowStr = &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;li&amp;gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum103"&gt; 103:&lt;/span&gt;                 rowStr += &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;a href='#' class='active_person' id=&amp;quot;&lt;/span&gt; + person[&lt;span style="color: #006080"&gt;&amp;quot;Id&amp;quot;&lt;/span&gt;] + &lt;span style="color: #006080"&gt;&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum104"&gt; 104:&lt;/span&gt;                 rowStr += person[&lt;span style="color: #006080"&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;];&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum105"&gt; 105:&lt;/span&gt;                 rowStr += &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;/a&amp;gt;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum106"&gt; 106:&lt;/span&gt;                 rowStr += &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;/li&amp;gt;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum107"&gt; 107:&lt;/span&gt;                 &lt;span style="color: #008000"&gt;//could fade this in?&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum108"&gt; 108:&lt;/span&gt;                 $(rowStr).appendTo(&lt;span style="color: #006080"&gt;&amp;quot;#names_list&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum109"&gt; 109:&lt;/span&gt;             }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum110"&gt; 110:&lt;/span&gt;         } &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum111"&gt; 111:&lt;/span&gt;     &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;h1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;             MS-Zentity RESTful Mashup&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;h1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;h2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;             Search By Name&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;h2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;input&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;txtName&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;text&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;evans&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;input&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;btnSearch&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;button&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Search&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;span&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;urlUsed&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;span&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Results&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Names&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Works&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The full project can be downloaded &lt;a title="RESTful Zentity concept fro #dev8D" href="http://sites.google.com/site/martinsdevsite/Home/WebApp.zip?attredirects=0&amp;amp;d=1" target="_blank"&gt;from here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Issues&lt;/h3&gt;

&lt;p&gt;It wasn’t all plain sailing. I had no internet connection in my hotel room for a start so this was all off the top of my head! Also, the “ScholarlyWork” object contains a number of circular references that result in an exception being thrown when trying to parse the object into JSON. I got round this for the benefit of the demo by actually creating an anonymous type off the ScholarlyWork object and cherry picking the properties I wanted to return. Were this concept to be explored some more, I’d probably recommend utilising a data transformation object to enable specific fields to be returned, that way, different DTO’s could be used based on the data to be returned.&lt;/p&gt;

&lt;h3&gt;Further Ideas&lt;/h3&gt;

&lt;p&gt;I think the concept has legs but for it to scale, I think there’ll have to be a way of configuring any “content type collection” similar to the Scholarly namespace to state which objects should be exposed like this, then using reflection to scan for them when the object is first plugged in, the automatically generating the controller methods in the front end. The reflection idea is just a random thought which I need to prove or disprove but sounds pretty cool.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-7764275918127450643?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/7764275918127450643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2010/03/mashing-up-zentity.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/7764275918127450643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/7764275918127450643'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2010/03/mashing-up-zentity.html' title='Mashing Up Zentity'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_prPJEj560s4/S4_pVYrPJzI/AAAAAAAABM0/C7uj2m9rWuE/s72-c/ZentityHome%5B1%5D_thumb%5B3%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-8169916863750330394</id><published>2010-02-25T09:23:00.003Z</published><updated>2010-03-07T20:14:23.419Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='dev8D'/><title type='text'>Developer Happiness Day - dev8D</title><content type='html'>&lt;p&gt;I’m at &lt;a title="Developer Happiness" href="http://dev8d.org/" target="_blank"&gt;dev8D&lt;/a&gt; at the University of London this week, organised by JISC as part of the &lt;a title="Developer Community Supporting Innovation" href="http://devcsi.ukoln.ac.uk/" target="_blank"&gt;DevCSI project&lt;/a&gt; to promote developer innovation. This is the second year of this event and being my first bar-camp event, I’m attending a number of coding dojo events as well as taking part in coding challenge with a chance of winning some cool tech!&lt;/p&gt;  &lt;p&gt;I didn’t really know what to expect when I arrived yesterday and entered a room containing over 220 delegates but was really impressed at the relaxed, friendly and helpful attitude of everyone I met. &lt;/p&gt;  &lt;p&gt;Having attended a Yahoo pipes dojo yesterday, I’m booked in for a similar ruby-on-rails session today. As this event is ran as a bar camp, there are also over 80 Expert lightning talks being held all week on all subjects from NGS Application portals to a talk entitled “Wordpress:Don’t talk to me about f*cking blogs&amp;quot;!”&lt;/p&gt;  &lt;p&gt;There was a games night held last night which was a good chance to meet the other delegates while playing “developer bingo” and other games. However, I still stand by my decision to decline the chance to play a bizarre game about werewolves…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-8169916863750330394?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/8169916863750330394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2010/02/developer-happiness-day-dev8d.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/8169916863750330394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/8169916863750330394'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2010/02/developer-happiness-day-dev8d.html' title='Developer Happiness Day - dev8D'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-5717191778240621459</id><published>2010-02-15T14:01:00.000Z</published><updated>2010-03-07T20:15:47.327Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Software Design'/><title type='text'>Abstracting Application Settings</title><content type='html'>&lt;p&gt;In a effort to maintain the testability of my code, I’ve started exposing my application settings from an abstraction layer. The settings are then passed into consumer object (classes) as needed using interface injection (aka &lt;a title="Dependency Injection thoery by Martin Fowler" href="http://www.martinfowler.com/articles/injection.html#FormsOfDependencyInjection" target="_blank"&gt;dependency injection&lt;/a&gt;). &lt;/p&gt;  &lt;p&gt;Consider the fictitious example below. The DiscountCalculator class contains the function FinalOrderAmount. This function returns total cost of an order based on the number of order items. If the number of items in the order exceeds a specific number, a discount is applied and the discounted value is returned, otherwise the original value is returned. The number of items that trigger the discount and the amount to discount the cost by, are held in an object that implements IContainDiscountSettings.&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; IContainDiscountSettings&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Discount { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; NumberOfItemsToTriggerDiscount { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; DiscountCalculator&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; IContainDiscountSettings _settings;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; DiscountCalculator(IContainDiscountSettings settings)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;             _settings = settings;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;double&lt;/span&gt; FinalOrderAmount(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; itemCount, &lt;span style="color: #0000ff"&gt;double&lt;/span&gt; cost)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (itemCount &amp;gt;= _settings.NumberOfItemsToTriggerDiscount)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (cost / 100) * (100 - _settings.Discount);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; cost;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;By injecting an instance of IContainDiscountSettings into the constructor, the DiscountCalculator class becomes loosely coupled to the IContainDiscountSettings instance, enabling it to be unit tested in isolation. The test below checks that the FinalOrderAmount function applies a discount when the number of items reaches equals the trigger value held in the settings object. In this instance, we’ve injected a test stub implementing IContainDiscountSettings. Using a stub in this way, allows us to set different values for each test case written.&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; [TestFixture]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; DiscountCalculatorTest&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     [Test]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; DiscountAppliedWhenTriggerAmountMet()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// Arrange&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; triggerItemCount = 5;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;double&lt;/span&gt; itemCost = 30.00;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;         IContainDiscountSettings settings = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DiscountSettingsStub()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;                                                 {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;                                                     Discount = 15,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;                                                     NumberOfItemsToTriggerDiscount = triggerItemCount&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;                                                 };&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;    &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;         var subject = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DiscountCalculator(settings);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// Act           &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;double&lt;/span&gt; orderAmount = subject.FinalOrderAmount(triggerItemCount, itemCost);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// Assert&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;         Assert.Less(orderAmount, itemCost,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt;                     &lt;span style="color: #006080"&gt;&amp;quot;Order cost should be less than cost of all items due to dicount being triggered&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum28"&gt;  28:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum29"&gt;  29:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum30"&gt;  30:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum31"&gt;  31:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum32"&gt;  32:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; DiscountSettingsStub : IContainDiscountSettings&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum33"&gt;  33:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum34"&gt;  34:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum35"&gt;  35:&lt;/span&gt;     &lt;span style="color: #cc6633"&gt;#region&lt;/span&gt; IContainDiscountSettings Members&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum36"&gt;  36:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum37"&gt;  37:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Discount&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum38"&gt;  38:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum39"&gt;  39:&lt;/span&gt;         get;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum40"&gt;  40:&lt;/span&gt;         set;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum41"&gt;  41:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum42"&gt;  42:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum43"&gt;  43:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; NumberOfItemsToTriggerDiscount&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum44"&gt;  44:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum45"&gt;  45:&lt;/span&gt;         get;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum46"&gt;  46:&lt;/span&gt;         set;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum47"&gt;  47:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum48"&gt;  48:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum49"&gt;  49:&lt;/span&gt;     &lt;span style="color: #cc6633"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum50"&gt;  50:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;h2&gt;Deriving from the ConfigurationSection&lt;/h2&gt;

&lt;p&gt;OK, so I’ve finally heeded the calls of the cool kids on twitter and started to utilise custom configuration sections in the app.config file.&amp;#160; I don’t necessarily feel like one of the cool kids but feel I’ve got one less thing for me to get brow beaten over!&lt;/p&gt;

&lt;p&gt; Here’s how we can an hold our DiscountSettings values in our app.config file without using the “filthy” appSettings element.&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #800000"&gt;xml&lt;/span&gt; &lt;span style="color: #ff0000"&gt;version&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;encoding&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;utf-8&amp;quot;&lt;/span&gt; ?&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;configuration&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;configSections&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;section&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;DiscountSettings&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;MyWorkingApp.DiscountSettings,MyWorkingApp&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;configSections&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;DiscountSettings&lt;/span&gt;  &lt;span style="color: #ff0000"&gt;CustomerDiscount&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;25&amp;quot;&lt;/span&gt;  &lt;span style="color: #ff0000"&gt;TriggerDiscountItems&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;20&amp;quot;&lt;/span&gt;  &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;configuration&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;As you can see, I’ve added a section element into the configSections element to declare the config section, then added the DiscountSettings element to hold all my values as attributes. I must admit, it &lt;strong&gt;does&lt;/strong&gt; make things a lot more manageable than tossing everything in the appSettings section.&lt;/p&gt;

&lt;p&gt;We can read the values from our app using the class below…&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; DiscountSettings : ConfigurationSection&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;      [ConfigurationProperty(&lt;span style="color: #006080"&gt;&amp;quot;CustomerDiscount&amp;quot;,IsRequired=true&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Discount&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;             get&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;[&lt;span style="color: #006080"&gt;&amp;quot;CustomerDiscount&amp;quot;&lt;/span&gt;];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;             set&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;[&lt;span style="color: #006080"&gt;&amp;quot;CustomerDiscount&amp;quot;&lt;/span&gt;] = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;         [ConfigurationProperty(&lt;span style="color: #006080"&gt;&amp;quot;TriggerDiscountItems&amp;quot;,IsRequired=true&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; NumberOfItemsToTriggerDiscount&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;             get&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;[&lt;span style="color: #006080"&gt;&amp;quot;TriggerDiscountItems&amp;quot;&lt;/span&gt;];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt;             set&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum28"&gt;  28:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;[&lt;span style="color: #006080"&gt;&amp;quot;TriggerDiscountItems&amp;quot;&lt;/span&gt;] = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum29"&gt;  29:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum30"&gt;  30:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum31"&gt;  31:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;… which derives from the &lt;a title="CustomConfiguration object definition on MSDN" href="http://msdn.microsoft.com/en-us/library/system.configuration.configurationsection.aspx" target="_blank"&gt;ConfigurationSection&lt;/a&gt; class of the .NET stack and although, there is a little more ceremony than reading in from the appSettings section, there are some benefits: Decorating each required property or the class with the “IsRequired=True” property on the ConfigurationProperty attribute, ensures that an exception is thrown if the setting is missing in the config file as soon as the class is initialised, rather than than when you try to retrieve the value and use it. You can also set default values if you don’t want to specify the value in the config file but that seems a bit dirty to me.&lt;/p&gt;

&lt;p&gt; We can declare an instance of our DiscountSettings object as so…&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;var settings = ConfigurationManager.GetSection(&lt;span style="color: #006080"&gt;&amp;quot;DiscountSettings&amp;quot;&lt;/span&gt;)&lt;span style="color: #0000ff"&gt;as&lt;/span&gt; DiscountSettings;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;…and by configuring it to implement IContainDiscountSettings, an instance of it can be injected into our DiscountCalculator as needed: &lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; DiscountSettings : ConfigurationSection, IContainDiscountSettings&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;h2&gt;Wrap Up&lt;/h2&gt;

&lt;p&gt;Using the Interface Injection method described above, we can easily switch our application settings management solution as the need arises. By writing a class that implements the necessary settings management interface, we could easily read our settings from a database, registry or even a network stream. It also enables us to effectively test consumer object in isolation.&lt;/p&gt;

&lt;p&gt;Any feedback would be welcome if there’s a better way of achieving this :-)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-5717191778240621459?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/5717191778240621459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2010/02/maintaining-settings-abstraction.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/5717191778240621459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/5717191778240621459'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2010/02/maintaining-settings-abstraction.html' title='Abstracting Application Settings'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-5012735084790563539</id><published>2010-01-06T14:42:00.001Z</published><updated>2010-03-07T20:16:26.408Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='rant'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.Net MVC'/><title type='text'>The Deprecation of Web Forms</title><content type='html'>&lt;p&gt;&lt;a title="2010 Technology Predictions" href="http://geekswithblogs.net/evjen/archive/2010/01/05/137357.aspx" target="_blank"&gt;Bill Evjen&lt;/a&gt; has predicted a community fight will kick off between the ASP.Net Web Form developer base that has been built up over the last 10 years, and the ASP.NET MVC adopters and the recently created &lt;a title="ASP.NET Webforms MVP" href="http://webformsmvp.com/" target="_blank"&gt;WebForms MVP project&lt;/a&gt; (with a number of Microsoft MVP’s at the helm) seems to support this argument.&lt;/p&gt;  &lt;p&gt;I&amp;#160; think this could be more of a hot potato than the ongoing &lt;a title="NHibernate vs Entity Framework. Pick a side!" href="http://images.google.co.uk/search?q=EF/NHIBERNATE&amp;amp;hl=en&amp;amp;client=firefox-a&amp;amp;rls=org.mozilla:en-GB:official&amp;amp;sa=G&amp;amp;um=1&amp;amp;ei=Ep1ES_DoDsz14AaG0IiqCA&amp;amp;oi=images_breadcrumbs_list&amp;amp;ct=images-breadcrumbs-list&amp;amp;cd=1" target="_blank"&gt;EF/NHibernate debacle&lt;/a&gt; but where that is a “MS v Open Source” debate, Microsoft are playing both sides in the MVP/MVC smack down and I don’t really think MS will win either way as it is just sending out confusing messages. &lt;/p&gt;  &lt;p&gt; So the big question is for my next project, do I use Web Forms or MVC? What are the cool kids using? It depends which one’s you ask! If Microsoft’s “Most Valued Professionals” can’t decide on a clear, unambiguous path regarding web development using .NET what chance have the rest of the developers out there got? &lt;/p&gt;  &lt;p&gt; Perhaps the question to ask is “Will web forms become deprecated?” or rather “&lt;strong&gt;When&lt;/strong&gt; will web forms become deprecated?” &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-5012735084790563539?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/5012735084790563539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2010/01/deprecation-of-web-forms.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/5012735084790563539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/5012735084790563539'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2010/01/deprecation-of-web-forms.html' title='The Deprecation of Web Forms'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-3237098705708057962</id><published>2010-01-05T10:45:00.002Z</published><updated>2010-03-07T20:19:15.983Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='BOOKS'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>My Year In Books</title><content type='html'>&lt;p&gt;This is how Amazon made its money out of me in 2009:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_prPJEj560s4/S0MYY2JjOPI/AAAAAAAABLo/LPPLGCMk4y0/s1600-h/2009_in_books%5B2%5D.jpg"&gt;&lt;img style="border-width: 0px; display: inline;" title="2009_in_books" alt="2009_in_books" src="http://lh6.ggpht.com/_prPJEj560s4/S0MYZRUBLoI/AAAAAAAABLs/5SNXhpUc_k4/2009_in_books_thumb.jpg?imgmax=800" width="244" border="0" height="239" /&gt;&lt;/a&gt; &lt;/p&gt;    &lt;h3&gt;&lt;a title="Get this book on Amazon" href="http://www.amazon.co.uk/Professional-ASP-NET-MVC-Wrox-Programmer/dp/0470384611/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1262687185&amp;amp;sr=8-1" target="_blank"&gt;ASP.NET MVC 1.0&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;A good introduction to the MVC Framework at the time but seemed to be just thrown out there to catch the market. The biggest chapter (“Nerd Dinner”) was actually given away for free before the book was released to coincide with the release of the framework. If you haven’t already brought it, get something else is my advice…&lt;/p&gt;    &lt;h3&gt;&lt;a title="Get Linq in Action on Amazon" href="http://www.amazon.co.uk/LINQ-Action-Fabrice-Marguerie/dp/1933988169/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1262687241&amp;amp;sr=8-1" target="_blank"&gt;LINQ in Action&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;My first Manning book. It gave me everything I needed to know to get me developing using LINQ in a clear and well thought out manner. As it’s such a rich book covering so many different facets of LINQ, I think I’ll re-read it later this year and probably discover something I previously missed.&lt;/p&gt;    &lt;h3&gt;&lt;a title="Get jQuery In Action on Amazon" href="http://www.amazon.co.uk/jQuery-Action-Bear-Bibeault/dp/1933988355/ref=pd_sim_b_5" target="_blank"&gt;jQuery in Action&lt;/a&gt; &lt;/h3&gt;  &lt;p&gt;It was like buying my first copy of Razzle! Have I mentioned jQuery rocks?! There are so many projects I would have liked to used jQuery on, in the last 10 years. This book gives you everything you need to get you started and although it may take you a solid day or two to read, I can guarantee it will save you days of hacking about with JavaScript for every subsequent project.&lt;/p&gt;    &lt;h3&gt;&lt;a title="Get it on Amazon" href="http://www.amazon.co.uk/MCTS-Self-Paced-Training-70-536-Framework-Application/dp/0735626197/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1262687328&amp;amp;sr=8-1" target="_blank"&gt;MCTS Training Kit Exam 70-536&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;Pretty much everything you need to know about the .NET framework prior to deciding if you want to specialize in Web/Winforms development using the .NET Stack. It’s essential reading regardless of if you want to take the 70-536 exam or not. (I really don’t know how they’re going to condense all this down into one exam with a platform specialty subject in 2010)&lt;/p&gt;    &lt;h3&gt;&lt;a title="Get it on Amazon" href="http://www.amazon.co.uk/Art-Unit-Testing-Examples-NET/dp/1933988274/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1262687386&amp;amp;sr=8-1" target="_blank"&gt;The Art Of Unit Testing&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;This book helped me realise I was on the right lines with how I am using unit tests. I like the way Roy Osherove encourages the developer to think of the unit tests as end users of the code we write, as well as the human beings on the end of the keyboard.&lt;/p&gt;    &lt;h3&gt;Going Open Source&lt;/h3&gt;  &lt;p&gt;I brought &lt;a title="Get it on Amazon" href="http://www.amazon.co.uk/Dive-into-Python-Books-Professionals/dp/1430224150/ref=sr_1_2?ie=UTF8&amp;amp;s=books&amp;amp;qid=1262687426&amp;amp;sr=8-2" target="_blank"&gt;Dive Into Python&lt;/a&gt;, &lt;a title="Get it on Amazon" href="http://www.amazon.co.uk/Definitive-Guide-Django-Development-Experts/dp/143021936X/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1262687460&amp;amp;sr=8-1" target="_blank"&gt;The Definitive Guide to DJango&lt;/a&gt; and &lt;a title="Get it on Amazon" href="http://www.amazon.co.uk/Ubuntu-Unleashed-2010-Covering-9-10/dp/0672331098/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1262687512&amp;amp;sr=8-1" target="_blank"&gt;UBuntu 2010 Edition&lt;/a&gt; to support my spur into the open source space. I’ll probably do a couple posts on that subject from a Microsoft Dev’s perspective later in the year.&lt;/p&gt;    &lt;p&gt; Here’s to the Amazon “One-Click” Facade.&lt;/p&gt;  &lt;p&gt; &lt;a href="http://lh5.ggpht.com/_prPJEj560s4/S0Mldt_fZbI/AAAAAAAABLw/SJiSchCUfKY/s1600-h/one-click%5B2%5D.jpg"&gt;&lt;img style="border: 0px none; display: inline;" title="one-click" alt="one-click" src="http://lh3.ggpht.com/_prPJEj560s4/S0MleS1CBFI/AAAAAAAABL0/22Ik09afg90/one-click_thumb.jpg?imgmax=800" width="204" border="0" height="84" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You helped me spend my money wisely this year….&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-3237098705708057962?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/3237098705708057962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2010/01/my-year-in-books.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/3237098705708057962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/3237098705708057962'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2010/01/my-year-in-books.html' title='My Year In Books'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_prPJEj560s4/S0MYZRUBLoI/AAAAAAAABLs/5SNXhpUc_k4/s72-c/2009_in_books_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-4101118788513963193</id><published>2009-12-20T12:09:00.002Z</published><updated>2010-03-07T20:24:28.509Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Gotchas'/><category scheme='http://www.blogger.com/atom/ns#' term='jQuery'/><title type='text'>jQuery Dialog Box Hacks</title><content type='html'>&lt;p&gt;&lt;img style="border-width: 0px; margin: 15px 10px 0px; display: inline;" title="dialog_suck" alt="dialog_suck" src="http://lh4.ggpht.com/_prPJEj560s4/Sy6SyDtRFKI/AAAAAAAABH4/ZLJBP62VedQ/dialog_suck_thumb%5B1%5D.jpg?imgmax=800" width="180" align="right" border="0" height="123" /&gt;I've become a huge advocate of &lt;a title="Interactive customisations using jQuery" href="http://jqueryui.com/" target="_blank"&gt;jQuery UI&lt;/a&gt; this year. Built on the &lt;a title="Reveloutionary Javascript library" href="http://jquery.com/" target="_blank"&gt;jQuery&lt;/a&gt; framework, it enables a developer to create themed, cross-browser compliant interactive pages in minutes with little effort, and now that the &lt;a title="jQueryUI available on the Google CDN" href="http://encosia.com/2009/10/11/do-you-know-about-this-undocumented-google-cdn-feature/" target="_blank"&gt;jQuery UI framework including many themes are available on the Google CDN&lt;/a&gt;, you don’t even have to serve the scripts from your own server!&lt;/p&gt;  &lt;p&gt;One of the widgets found in the jQuery UI framework is the Dialog widget which offers a more stylish and flexible, client side dialog than the traditional JavaScript alert box:
&lt;/p&gt;  &lt;h4&gt;A Quick Example of the jQuery Dialog Widget&lt;/h4&gt;  &lt;p&gt;In the code box below, is the mark-up for a simple web page containing a div tag with an id of “box1”. The tag has a title attribute and contains a further div element with an id of “content”.&lt;/p&gt;    &lt;div   style="border: 1px solid silver; text-align: left; padding: 4px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 20px 0px 10px; width: 97.94%; direction: ltr; height: 242px; max-height: 200px; overflow: auto; cursor: text;font-family:'Courier New',courier,monospace;font-size:8pt;" id="codeSnippetWrapper"&gt;   &lt;div    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;" id="codeSnippet"&gt;     &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&amp;lt;!DOCTYPE html PUBLIC &lt;span style="color: rgb(0, 96, 128);"&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/span&gt; &lt;span style="color: rgb(0, 96, 128);"&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&amp;lt;html xmlns=&lt;span style="color: rgb(0, 96, 128);"&gt;"http://www.w3.org/1999/xhtml"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&amp;lt;head&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;    &amp;lt;title&amp;gt;jQuery-Dialog Demo Page1 &lt;span style="color: rgb(0, 0, 255);"&gt;for&lt;/span&gt; Martins Antics In Software Development&amp;lt;/title&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;    &amp;lt;script type=&lt;span style="color: rgb(0, 96, 128);"&gt;"text/javascript"&lt;/span&gt; src=&lt;span style="color: rgb(0, 96, 128);"&gt;"http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;    &amp;lt;script type=&lt;span style="color: rgb(0, 96, 128);"&gt;"text/javascript"&lt;/span&gt; src=&lt;span style="color: rgb(0, 96, 128);"&gt;"http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;    &amp;lt;link href=&lt;span style="color: rgb(0, 96, 128);"&gt;"http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/cupertino/jquery-ui.css"&lt;/span&gt; rel=&lt;span style="color: rgb(0, 96, 128);"&gt;"stylesheet"&lt;/span&gt; type=&lt;span style="color: rgb(0, 96, 128);"&gt;"text/css"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&amp;lt;/head&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&amp;lt;body&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;    &amp;lt;h1&amp;gt;Dialog Demo&amp;lt;/h1&amp;gt;    &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;    &amp;lt;div id=&lt;span style="color: rgb(0, 96, 128);"&gt;'box1'&lt;/span&gt; title=&lt;span style="color: rgb(0, 96, 128);"&gt;'Demo Dialog Box'&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;    &amp;lt;div id=&lt;span style="color: rgb(0, 96, 128);"&gt;'content'&lt;/span&gt;&amp;gt;Here &lt;span style="color: rgb(0, 0, 255);"&gt;is&lt;/span&gt; some demo content&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;    &amp;lt;/div&amp;gt;    &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&amp;lt;/body&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
 The rendered contents of which can be seen below:
&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_prPJEj560s4/Sy6SynN1G8I/AAAAAAAABH8/yjBX6uJbPDI/s1600-h/markup_not_init%5B7%5D.jpg"&gt;&lt;img style="border-width: 0px; display: inline;" title="markup_not_init" alt="markup_not_init" src="http://lh5.ggpht.com/_prPJEj560s4/Sy6SzJiCD1I/AAAAAAAABIA/OiIUOsRuvXQ/markup_not_init_thumb%5B5%5D.jpg?imgmax=800" width="526" border="0" height="480" /&gt;&lt;/a&gt; &lt;/p&gt;
Not very exciting…as  expected! Now lets add some jQuery UI “love gravy” and see what happens. At the end of the head block in the page’s mark-up, add the following script block:
 &lt;div   style="border: 1px solid silver; text-align: left; padding: 4px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 20px 0px 10px; width: 97.5%; direction: ltr; max-height: 200px; overflow: auto; cursor: text;font-family:'Courier New',courier,monospace;font-size:8pt;" id="codeSnippetWrapper"&gt;
&lt;div    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;" id="codeSnippet"&gt;
   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&amp;lt;script type=&lt;span style="color: rgb(0, 96, 128);"&gt;"text/javascript"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;   $(&lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt;() { &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;        $(&lt;span style="color: rgb(0, 96, 128);"&gt;"#box1"&lt;/span&gt;).dialog({&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;                bgiframe: &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;,                   &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;                modal: &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;,                &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;                overlay: {&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;                    backgroundColor: &lt;span style="color: rgb(0, 96, 128);"&gt;'#000'&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;                    opacity: 0.5&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;                },        &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;                buttons: {&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;                        OK: &lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt;() {$(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;).dialog(&lt;span style="color: rgb(0, 96, 128);"&gt;'close'&lt;/span&gt;);},&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;                        Cancel: &lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt;() {$(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;).dialog(&lt;span style="color: rgb(0, 96, 128);"&gt;'close'&lt;/span&gt;);}&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;                }&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;            });                    &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;        });&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;Reloading the page in our browser, now give us this:

&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_prPJEj560s4/Sy6Szq0UFEI/AAAAAAAABIE/RatR-5pFUgw/s1600-h/dialog_one_init%5B3%5D.jpg"&gt;&lt;img style="border-width: 0px; display: inline;" title="dialog_one_init" alt="dialog_one_init" src="http://lh6.ggpht.com/_prPJEj560s4/Sy6S0ENrxOI/AAAAAAAABII/IpK8nYTXLSw/dialog_one_init_thumb%5B1%5D.jpg?imgmax=800" width="526" border="0" height="480" /&gt;&lt;/a&gt; &lt;/p&gt;Lets take a look at that sweet sweet code we’ve just added and figure out what we’ve done.
&lt;div   style="border: 1px solid silver; text-align: left; padding: 4px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 20px 0px 10px; width: 97.5%; direction: ltr; max-height: 200px; overflow: auto; cursor: text;font-family:'Courier New',courier,monospace;font-size:8pt;" id="codeSnippetWrapper"&gt;
 &lt;div    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;" id="codeSnippet"&gt;
   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum1"&gt;   1:&lt;/span&gt; &amp;lt;script type=&lt;span style="color: rgb(0, 96, 128);"&gt;"text/javascript"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum2"&gt;   2:&lt;/span&gt;    $(&lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt;() { &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum3"&gt;   3:&lt;/span&gt;         $(&lt;span style="color: rgb(0, 96, 128);"&gt;"#box1"&lt;/span&gt;).dialog({&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum4"&gt;   4:&lt;/span&gt;                 bgiframe: &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;,                   &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum5"&gt;   5:&lt;/span&gt;                 modal: &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;,                &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum6"&gt;   6:&lt;/span&gt;                 overlay: {&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum7"&gt;   7:&lt;/span&gt;                     backgroundColor: &lt;span style="color: rgb(0, 96, 128);"&gt;'#000'&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum8"&gt;   8:&lt;/span&gt;                     opacity: 0.5&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum9"&gt;   9:&lt;/span&gt;                 },        &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum10"&gt;  10:&lt;/span&gt;                 buttons: {&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum11"&gt;  11:&lt;/span&gt;                         OK: &lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt;() {$(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;).dialog(&lt;span style="color: rgb(0, 96, 128);"&gt;'close'&lt;/span&gt;);},&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum12"&gt;  12:&lt;/span&gt;                         Cancel: &lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt;() {$(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;).dialog(&lt;span style="color: rgb(0, 96, 128);"&gt;'close'&lt;/span&gt;);}&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum13"&gt;  13:&lt;/span&gt;                 }&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum14"&gt;  14:&lt;/span&gt;             });                    &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum15"&gt;  15:&lt;/span&gt;         });&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum16"&gt;  16:&lt;/span&gt; &amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;In line 2, we’re declaring a function to be ran when jQuery’s “document.Ready” event is fired. This event is raised when the Document Object Model (DOM) for the page is loaded by the browser but hasn’t been rendered by the browser yet. This is one of the most useful jQuery events, as it means we can start hacking around with the DOM before anything has been displayed.
So lets look a little closer at the dialog function. We select the DIV element with the id of “box1” using the $(“#box1”) selector syntax, and call a function on it called “dialog”. This function is defined in the jQuery UI library. The remaining lines are concerned with passing pre-defined parameters into the function via an &lt;a title="Object initializers at the Mozilla developer center" href="https://developer.mozilla.org/En/Core_JavaScript_1.5_Guide/Creating_New_Objects/Using_Object_Initializers"&gt;object literal (AKA an Object Initializer)&lt;/a&gt;.  The most notable options in this case being:

&lt;table&gt;&lt;tbody&gt;
   &lt;tr&gt;
     &lt;th&gt;Name&lt;/th&gt;

     &lt;th&gt;Type&lt;/th&gt;

     &lt;th&gt;Description&lt;/th&gt;
   &lt;/tr&gt;

   &lt;tr&gt;
     &lt;td&gt;modal&lt;/td&gt;

     &lt;td&gt;Boolean&lt;/td&gt;

     &lt;td&gt;Denotes whether to display the box modally – so no other part of the page is accessible until the dialog has been unloaded&lt;/td&gt;
   &lt;/tr&gt;

   &lt;tr&gt;
     &lt;td valign="top" width="167"&gt;buttons&lt;/td&gt;

     &lt;td valign="top" width="111"&gt;object&lt;/td&gt;

     &lt;td valign="top" width="221"&gt;An object literal, containing a list of buttons to be displayed along with the functions to be ran if pressed. The text of the button is taken from the name of each property.&lt;/td&gt;
   &lt;/tr&gt;
 &lt;/tbody&gt;&lt;/table&gt;A complete list of options available and more can be found on the &lt;a title="jQuery UI Dialog page" href="http://jqueryui.com/demos/dialog/" target="_blank"&gt;jQuery UI Site&lt;/a&gt; and &lt;a href="http://sites.google.com/site/martinsdevsite/Home/dialogdemo.txt" target="_blank"&gt;here’s that demo page to download&lt;/a&gt; if you want to play around with it yourselves. (I’ve saved it as a text file so you can check it before saving it to a web page)

I cannot convey the value of using jQuery UI better than has been blogged elsewhere on the web so I’m not going to bother. Needless to say, I think you need a pretty good excuse not to use it. I’m blogging this post because I ran into a couple of issues the other day, while using the Dialog widget and wanted to post my findings. 

&lt;h4&gt;Issues around Escaping, Closing and Scrolling with the Dialog Widget&lt;/h4&gt;In a feature I’m putting together, I have to challenge the user using a modal Dialog, with a "Yes/No" scenario when a particular page is loads. The contents of the page depend on their response and a specific function is then called depending on the button they press.

&lt;p&gt;Here is a concept page showing what I need to do:&lt;/p&gt;  &lt;div   style="border: 1px solid silver; text-align: left; padding: 4px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 20px 0px 10px; width: 97.5%; direction: ltr; max-height: 200px; overflow: auto; cursor: text;font-family:'Courier New',courier,monospace;font-size:8pt;" id="codeSnippetWrapper"&gt;
&lt;div    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;" id="codeSnippet"&gt;
   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;&amp;lt;!DOCTYPE html PUBLIC &lt;span style="color: rgb(0, 96, 128);"&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/span&gt; &lt;span style="color: rgb(0, 96, 128);"&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&amp;lt;html xmlns=&lt;span style="color: rgb(0, 96, 128);"&gt;"http://www.w3.org/1999/xhtml"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&amp;lt;head&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;    &amp;lt;title&amp;gt;jQuery-Dialog Demo Page &lt;span style="color: rgb(0, 0, 255);"&gt;for&lt;/span&gt; Martins Antics In Software Development&amp;lt;/title&amp;gt;    &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;    &amp;lt;script type=&lt;span style="color: rgb(0, 96, 128);"&gt;"text/javascript"&lt;/span&gt; src=&lt;span style="color: rgb(0, 96, 128);"&gt;"http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;        &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;    &amp;lt;script type=&lt;span style="color: rgb(0, 96, 128);"&gt;"text/javascript"&lt;/span&gt; src=&lt;span style="color: rgb(0, 96, 128);"&gt;"http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;    &amp;lt;link href=&lt;span style="color: rgb(0, 96, 128);"&gt;"http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/cupertino/jquery-ui.css"&lt;/span&gt; rel=&lt;span style="color: rgb(0, 96, 128);"&gt;"stylesheet"&lt;/span&gt; type=&lt;span style="color: rgb(0, 96, 128);"&gt;"text/css"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;    &amp;lt;script type=&lt;span style="color: rgb(0, 96, 128);"&gt;"text/javascript"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;        &lt;span style="color: rgb(0, 128, 0);"&gt;// When the DOM is ready, call the DisplayModalBox function, &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;        &lt;span style="color: rgb(0, 128, 0);"&gt;// passing in functions for when the user agrees with the terms and conditions displayed on screen&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;        &lt;span style="color: rgb(0, 128, 0);"&gt;// and the function to run if the user disagrees&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;        $(&lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt;() { DisplayModalBox(DisplayAgreeMessage,DisplayDisagreeMessage); } ); &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;        &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt; DisplayModalBox(onAgree, onDisagree) {    &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;            $(&lt;span style="color: rgb(0, 96, 128);"&gt;"#box1"&lt;/span&gt;).dialog({&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;                bgiframe: &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                resizable: &lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;,    &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;                width: 300,&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                modal: &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;                closeOnEscape: &lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                overlay: {&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                    backgroundColor: &lt;span style="color: rgb(0, 96, 128);"&gt;'#000'&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                    opacity: 0.5&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                },        &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                buttons: {&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                        &lt;span style="color: rgb(0, 96, 128);"&gt;'Yes'&lt;/span&gt;: &lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt;() {                &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                            &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(0, 0, 255);"&gt;typeof&lt;/span&gt; onAgree == &lt;span style="color: rgb(0, 96, 128);"&gt;'function'&lt;/span&gt;) onAgree();&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                            $(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;).dialog(&lt;span style="color: rgb(0, 96, 128);"&gt;'close'&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                        },&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                        &lt;span style="color: rgb(0, 96, 128);"&gt;"No"&lt;/span&gt;: &lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt;() {   &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                            &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(0, 0, 255);"&gt;typeof&lt;/span&gt; onDisagree == &lt;span style="color: rgb(0, 96, 128);"&gt;'function'&lt;/span&gt;) onDisagree();&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                            $(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;).dialog(&lt;span style="color: rgb(0, 96, 128);"&gt;'close'&lt;/span&gt;);                          &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                }&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;            });           &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;        &lt;span style="color: rgb(0, 128, 0);"&gt;// In this demo, this function is called if the user hits "Yes"&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt; DisplayAgreeMessage() &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;            {&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;                $(&lt;span style="color: rgb(0, 96, 128);"&gt;"#msg"&lt;/span&gt;).append(&lt;span style="color: rgb(0, 96, 128);"&gt;"&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Which you did!&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;"&lt;/span&gt;);            &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;        &lt;span style="color: rgb(0, 128, 0);"&gt;// Ditto for "No"        &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt; DisplayDisagreeMessage() &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;            {     &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;                $(&lt;span style="color: rgb(0, 96, 128);"&gt;"#msg"&lt;/span&gt;).empty().append(&lt;span style="color: rgb(0, 96, 128);"&gt;"&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;You didn't press Yes!&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;            } &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;    &amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;    &amp;lt;style type=&lt;span style="color: rgb(0, 96, 128);"&gt;"text/css"&lt;/span&gt; rel=&lt;span style="color: rgb(0, 96, 128);"&gt;"stylesheet"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;    body    { &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre face="'Courier New',courier,monospace" size="8pt" color="black" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; direction: ltr; overflow: visible;"&gt;            font-size:small;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;            font-family: arial;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;    #content &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;            {&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;            display:block;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;            overflow:auto; &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;            height:100px; &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;            border:solid 1px #cccccc; &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;            padding: 0px 5px;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;    &amp;lt;/style&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&amp;lt;/head&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&amp;lt;body&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;    &amp;lt;h1&amp;gt;Dialog Demo&amp;lt;/h1&amp;gt;    &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;    &amp;lt;div id=&lt;span style="color: rgb(0, 96, 128);"&gt;"msg"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;    &amp;lt;p&amp;gt;Prior to getting here, you should have pressed &lt;span style="color: rgb(0, 96, 128);"&gt;"Yes"&lt;/span&gt;&amp;lt;/p&amp;gt;    &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;    &amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;    &amp;lt;div id=&lt;span style="color: rgb(0, 96, 128);"&gt;'box1'&lt;/span&gt; title=&lt;span style="color: rgb(0, 96, 128);"&gt;'Please sign your life away'&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;    &amp;lt;div id=&lt;span style="color: rgb(0, 96, 128);"&gt;'content'&lt;/span&gt;&amp;gt;Etiam ornare egestas ante at varius. Suspendisse nec dui ac neque ultrices pretium a eget diam. Morbi aliquam egestas nulla ac convallis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sed arcu non tortor euismod suscipit ut nec odio. Donec arcu lacus, viverra quis &amp;lt;a href=&lt;span style="color: rgb(0, 96, 128);"&gt;"http://martinsantics.blogspot.com"&lt;/span&gt; title=&lt;span style="color: rgb(0, 96, 128);"&gt;"Martin Evans - Web Developer"&lt;/span&gt;&amp;gt;More stuff on C# Web Development&amp;lt;/a&amp;gt; pellentesque &lt;span style="color: rgb(0, 0, 255);"&gt;in&lt;/span&gt;, euismod nec turpis.&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;    &amp;lt;/div&amp;gt;    &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&amp;lt;/body&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;So basically, when the page loads, the user is challenged with a modal dialog box displaying what, in real life, would be a legal notice that the user has to agree to prior to proceeding, by pressing “Yes”. In the instance shown, the a relevant message is written to the screen after the user has pressed a button.

The first issue I ran into was the fact that the user could simply press the escape key to cancel the dialog box, giving them access to the page. &lt;strong&gt;This can be remedied by setting the "closeOnEscape" option to false&lt;/strong&gt;. This option is implicitly set to true by default so its important that you set it explicitly when initialising the dialog box. (Don’t worry! There’s a complete code listing for this solution at the bottom of the page along with a link to the code as a txt file)

In the feature I’m adding, the dialog box displays a scrollable content (DIV) element  - you know the type I'm talking about, it shows a mass of terms and conditions that the user is not going to read but agree to by pressing "Yes"!

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_prPJEj560s4/Sy6S0-J624I/AAAAAAAABIM/BTpefipHsHQ/s1600-h/dialog_two_init%5B3%5D.jpg"&gt;&lt;img style="border-width: 0px; display: inline;" title="dialog_two_init" alt="dialog_two_init" src="http://lh6.ggpht.com/_prPJEj560s4/Sy6S1cH2CyI/AAAAAAAABIQ/_An6R2fGq0Y/dialog_two_init_thumb%5B1%5D.jpg?imgmax=800" width="526" border="0" height="480" /&gt;&lt;/a&gt; &lt;/p&gt;This unread content contains a hyperlink towards the end of it and for some reason, when the dialog box renders, the scroll position of the div box sets itself to the position of the hyperlink. To get around this, &lt;strong&gt;I had to set the scrollTop attribute for the content div box to 0 after initialising the dialog. &lt;/strong&gt;

The final issue relates to the close button at the top right of the dialog box:


&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_prPJEj560s4/Sy6S1u1MQ6I/AAAAAAAABIU/LoixD87BPjU/s1600-h/dialog_two_close_button%5B3%5D.jpg"&gt;&lt;img style="border-width: 0px; display: inline;" title="dialog_two_close_button" alt="dialog_two_close_button" src="http://lh6.ggpht.com/_prPJEj560s4/Sy6S2KGzxbI/AAAAAAAABIY/M_y62Xcd1rw/dialog_two_close_button_thumb%5B1%5D.jpg?imgmax=800" width="340" border="0" height="77" /&gt;&lt;/a&gt; &lt;/p&gt;In this instance, I don't want the user to be able to click this as it will just close the box and give the user access to page in its current state. There are events that you can hook into within the the dialog box that fire when the Dialog box closes or is about to close and I'd considered utilising them but they introduce more complexity than is needed and would end up becoming

&lt;p&gt;&amp;lt;&lt;strong&gt;rhyme&lt;/strong&gt;&amp;gt;a pain to maintain&amp;lt;/&lt;strong&gt;ryhme&lt;/strong&gt;&amp;gt;.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;In the end I just use jQuery to remove the close button from the dialog box (see line 27 below)&lt;/strong&gt;&lt;/p&gt;The completed function to display the dialog box as I need it would then be this:
&lt;p&gt;&lt;/p&gt;&lt;div   style="border: 1px solid silver; text-align: left; padding: 4px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 20px 0px 10px; width: 97.5%; direction: ltr; max-height: 200px; overflow: auto; cursor: text;font-family:'Courier New',courier,monospace;font-size:8pt;" id="codeSnippetWrapper"&gt;
 &lt;div    style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; direction: ltr; overflow: visible;font-family:'Courier New',courier,monospace;font-size:8pt;color:black;" id="codeSnippet"&gt;
   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt; DisplayModalBox(onAgree, onDisagree) {    &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum2"&gt;   2:&lt;/span&gt;     $(&lt;span style="color: rgb(0, 96, 128);"&gt;"#box1"&lt;/span&gt;).dialog({&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum3"&gt;   3:&lt;/span&gt;         bgiframe: &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum4"&gt;   4:&lt;/span&gt;         resizable: &lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;,    &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum5"&gt;   5:&lt;/span&gt;         width: 300,&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum6"&gt;   6:&lt;/span&gt;         modal: &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;,                &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum7"&gt;   7:&lt;/span&gt;         closeOnEscape: &lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;, &lt;span style="color: rgb(0, 128, 0);"&gt;// Ensures the user can't escape out of the dialog box challenge&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum8"&gt;   8:&lt;/span&gt;         overlay: {&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum9"&gt;   9:&lt;/span&gt;             backgroundColor: &lt;span style="color: rgb(0, 96, 128);"&gt;'#000'&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum10"&gt;  10:&lt;/span&gt;             opacity: 0.5&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum11"&gt;  11:&lt;/span&gt;         },        &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum12"&gt;  12:&lt;/span&gt;         buttons: {&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum13"&gt;  13:&lt;/span&gt;                 &lt;span style="color: rgb(0, 96, 128);"&gt;'Yes'&lt;/span&gt;: &lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt;() {                &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum14"&gt;  14:&lt;/span&gt;                     &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(0, 0, 255);"&gt;typeof&lt;/span&gt; onAgree == &lt;span style="color: rgb(0, 96, 128);"&gt;'function'&lt;/span&gt;) onAgree();&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum15"&gt;  15:&lt;/span&gt;                     $(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;).dialog(&lt;span style="color: rgb(0, 96, 128);"&gt;'close'&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum16"&gt;  16:&lt;/span&gt;                 },&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum17"&gt;  17:&lt;/span&gt;                 &lt;span style="color: rgb(0, 96, 128);"&gt;"No"&lt;/span&gt;: &lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt;() {   &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum18"&gt;  18:&lt;/span&gt;                     &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(0, 0, 255);"&gt;typeof&lt;/span&gt; onDisagree == &lt;span style="color: rgb(0, 96, 128);"&gt;'function'&lt;/span&gt;) onDisagree();&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum19"&gt;  19:&lt;/span&gt;                     $(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;).dialog(&lt;span style="color: rgb(0, 96, 128);"&gt;'close'&lt;/span&gt;);                          &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum20"&gt;  20:&lt;/span&gt;                 }&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum21"&gt;  21:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum22"&gt;  22:&lt;/span&gt;     });&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum23"&gt;  23:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum24"&gt;  24:&lt;/span&gt;     &lt;span style="color: rgb(0, 128, 0);"&gt;// Ensure the content is scrolled to the top&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum25"&gt;  25:&lt;/span&gt;     $(&lt;span style="color: rgb(0, 96, 128);"&gt;"#content"&lt;/span&gt;).attr(&lt;span style="color: rgb(0, 96, 128);"&gt;"scrollTop"&lt;/span&gt;, &lt;span style="color: rgb(0, 96, 128);"&gt;"0"&lt;/span&gt;);        &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum26"&gt;  26:&lt;/span&gt;     &lt;span style="color: rgb(0, 128, 0);"&gt;// Remove the the close option from the dialog box&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum27"&gt;  27:&lt;/span&gt;     $(&lt;span style="color: rgb(0, 96, 128);"&gt;".ui-dialog-titlebar-close"&lt;/span&gt;).remove();                &lt;/pre&gt;
&lt;!--CRLF--&gt;

   &lt;pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"&gt;&lt;span style="color: rgb(96, 96, 96);" id="lnum28"&gt;  28:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;&lt;a href="http://sites.google.com/site/martinsdevsite/Home/dialogdemo3.txt" target="_blank"&gt;You can download the complete mark-up for this proof of concept page here&lt;/a&gt; (text file only so you can read and check it prior to running it in a browser).
&lt;h4&gt;It’s Dirty But It Works…&lt;/h4&gt;&lt;p&gt;I think removing the close button after the calling the dialog function is a bit dirty and I hang my head in shame for posting about it. I think it would be much better in my opinion if the dialog component could accept a “showClosebox” option which could be passed on initialisation of the dialog to stipulate whether a close button should be displayed. I've &lt;a title="jQuery UI ticket" href="http://dev.jqueryui.com/ticket/5015" target="_blank"&gt;submitted this as an enhancement&lt;/a&gt; with the jQuery team but for now the best way of getting around this issue is to be dirty.…&lt;/p&gt;&lt;h3&gt;UPDATE -  Jan 2010&lt;/h3&gt;&lt;p&gt;This enhancement request has been rejected so using the method above or a css hack will be the best method to render the dialog box without a close button.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-4101118788513963193?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/4101118788513963193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2009/12/jquery-dialog-box-hacks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/4101118788513963193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/4101118788513963193'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2009/12/jquery-dialog-box-hacks.html' title='jQuery Dialog Box Hacks'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_prPJEj560s4/Sy6SyDtRFKI/AAAAAAAABH4/ZLJBP62VedQ/s72-c/dialog_suck_thumb%5B1%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-8531276109267000277</id><published>2009-12-02T10:17:00.002Z</published><updated>2010-03-07T20:25:27.419Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gotchas'/><category scheme='http://www.blogger.com/atom/ns#' term='XSLT'/><title type='text'>Parsing Conditional Comments With XSLT</title><content type='html'>&lt;p&gt;This is just a quick heads up if your carrying out XSLT transformations to create HTML pages.  
The HTML pages I was creating, had to contain the the following conditional comment.&lt;/p&gt;  &lt;div   style="border: 1px solid gray; padding: 4px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 20px 0px 10px; width: 97.5%; max-height: 200px; overflow: auto; cursor: text;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;   &lt;div    style="border-style: none; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; overflow: visible;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;     &lt;pre    style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; overflow: visible;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&amp;lt;!--[if IE]&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre    style="border-style: none; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; overflow: visible;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;    &amp;lt;link rel="stylesheet" type="text/css" href="/styles/site_view_ie_hack.css" /&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre    style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; overflow: visible;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&amp;lt;![endif]--&amp;gt;&lt;/span&gt;&lt;/pre&gt;
 &lt;/div&gt;
&lt;/div&gt;
When I appended the XSL style sheet template with the statement, it was parsed with the angle brackets escaped, resulting in the conditional comment appearing as text on the actual page rather than as HTML mark-up.

To resolve this issue, I had to wrap the statement in a CDATA tag and wrap the CDATA tag in an &amp;lt;xsl:text&amp;gt; tag as so:
&lt;div   style="border: 1px solid gray; padding: 4px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 20px 0px 10px; width: 97.5%; max-height: 200px; overflow: auto; cursor: text;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;
 &lt;div    style="border-style: none; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; overflow: visible;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;
   &lt;pre    style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; overflow: visible;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;xsl:text&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;disable-output-escaping&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="yes"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre    style="border-style: none; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; overflow: visible;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;!&lt;/span&gt;[CDATA[&lt;/pre&gt;

   &lt;pre    style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; overflow: visible;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;      &lt;span style="color: rgb(0, 128, 0);"&gt;&amp;lt;!--[if IE]&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre    style="border-style: none; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; overflow: visible;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;          &amp;lt;link rel="stylesheet" type="text/css" href="/styles/site_view_ie_hack.css" /&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre    style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; overflow: visible;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;        &amp;lt;![endif]--&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre    style="border-style: none; padding: 0px; line-height: 12pt; background-color: rgb(244, 244, 244); margin: 0em; width: 100%; overflow: visible;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;    ]]&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre    style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; overflow: visible;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:black;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;xsl:text&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
 &lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The &lt;a title="XSLT text element tutorial at the W3Schools site" href="http://www.w3schools.com/xsl/el_text.asp" target="_blank"&gt;disable-output-escaping attribute in the &amp;lt;xsl:text&amp;gt; element&lt;/a&gt; is the enabling factor in this solution. It instructs the XSL parser not to escape any of the angle brackets in the conditional comment. Placing the conditional comment in a CDATA section ensures the Conditional Comment is parsed in the HTML output otherwise the XSL parser will just treat the conditional comment it as an XSL style sheet comment and won’t render it as output.&lt;/p&gt;&lt;p&gt;I hope this helps.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-8531276109267000277?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/8531276109267000277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2009/12/parsing-conditional-comments-with-xslt.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/8531276109267000277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/8531276109267000277'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2009/12/parsing-conditional-comments-with-xslt.html' title='Parsing Conditional Comments With XSLT'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-7516610688712621035</id><published>2009-11-23T20:07:00.001Z</published><updated>2009-11-23T20:08:25.680Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='BOOKS'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>The Purpose Of Unit Tests?</title><content type='html'>&lt;p&gt;I’ve just received a copy of “&lt;a title="Dive into Python 3 by Mark Pilgrim" href="http://www.amazon.com/gp/product/1430224150?ie=UTF8&amp;amp;tag=diveintomark-20&amp;amp;creativeASIN=1430224150" rel="tag" target="_blank"&gt;Dive Into Python 3&lt;/a&gt;” by &lt;a title="Mark Pilgrim&amp;#39;s blog" href="http://diveintomark.org/" target="_blank"&gt;Mark Pilgrim&lt;/a&gt;. Being a .NET “bee-hatch”, I’ve never come across any of his books before as he is an open source developer, and I’m not really sure what to expect.&lt;/p&gt;  &lt;p&gt;For some reason I automatically turned to the chapter on unit testing before anything else (strange!) and one of the reasons Mark gave for writing unit tests was this:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;“…it helps you cover your ass when someone comes screaming that your latest change broke their old code”&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Clear and unambiguous. I think I’m going to like this book!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-7516610688712621035?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/7516610688712621035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2009/11/want-quote-to-describe-purpose-of-unit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/7516610688712621035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/7516610688712621035'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2009/11/want-quote-to-describe-purpose-of-unit.html' title='The Purpose Of Unit Tests?'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-6951624511840205488</id><published>2009-11-18T21:14:00.002Z</published><updated>2010-03-07T20:26:07.237Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='rant'/><category scheme='http://www.blogger.com/atom/ns#' term='70-536'/><category scheme='http://www.blogger.com/atom/ns#' term='VS2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Certification'/><title type='text'>Microsoft .NET Exams</title><content type='html'>&lt;p&gt;Back in July, I blogged about studying for an MCPD in ASP.NET Developer 3.5 on Visual Studio 2008. I wanted (and still want) to improve my skill-set and raise my game as a developer. &lt;/p&gt;  &lt;p&gt;Since I began studying for the 70-536 exam, (one of the three exams you have to pass) I've learnt lots of new areas of the .NET stack that I hadn’t had any exposure to before, in particular GDI+ and the dark arts (aka regular expressions).&lt;/p&gt;    &lt;p&gt;My tardy pace of studying has been dictated by family and work commitments (that’s my excuse!) but as VS2010 is out early(?) next year, I'm starting to wonder whether I've left it too late to get any benefit from the topics I'm studying. &lt;/p&gt;  &lt;p&gt;Basically it boils down to this: The current exam path dictates that you sit 70-536 which, although challenging covers the the foundation topics of the framework, prior specialising in either web or the windows platform. But it would appear that the &lt;a href="http://blogs.msdn.com/gerryo/archive/2009/05/28/visual-studio-2010-exams-are-changing.aspx"&gt;certification path for VS2010 is changing quite dramatically&lt;/a&gt;:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;1 exam for MCTS Web Developer &lt;/li&gt;    &lt;li&gt;1 extra exam for MCPD Web Developer &lt;/li&gt;    &lt;li&gt;Greater emphasis on Silverlight in both exams&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I seem to get the impression that the .Net 4.0 core is so vastly different, the learning requirements covered in 70-536 are completely superseded. The Silverlight angle seems to dovetail in with &lt;a href="http://geekswithblogs.net/evjen/archive/2009/11/17/136363.aspx"&gt;Ray Ozzie's keynote at PDC 2009&lt;/a&gt; when he said that Silverlight's going to run our washing machines or something.... Personally, I think dynamically typed languages like python will be more widely utilised than Silverlight but it’s my blog and it’s my opinion!&lt;/p&gt;    &lt;p&gt; I think studying for an exam that’s going to be superseded in four months time is a waste of my time. I have learnt some new things however, that have been useful so I'm going to keep grokking but without the pressure of an exam or number of exams over my head.&lt;/p&gt;    &lt;p&gt;I’ll certainly look at the learning objectives for the MCPD 2010 syllabus when it’s rolled out but I think ASP.Net development covers too many different facets to warrant one or two examinations deciding if you're knowledge is good/bad/indifferent. I'll be better off spending quality time grokking on specific areas of need or concern. Having planted myself firmly in the ASP.Net MVC camp, I don't really want to touch web forms ever, &lt;strong&gt;ever&lt;/strong&gt; again so studying for an exam that covers web forms may also be a waste, but I acknowledge it would be foolish to completely discount them. Web forms will (sadly) be around for a long time to come. &lt;/p&gt;  &lt;p&gt;I'm going to emphasize on the MVC2 aspects of the 4.0 stack as well as the core issues. I'm not so sure about Silverlight. I may have to invest in a tech day in a similar way to &lt;a title="Rob the Geek" href="http://cantgrokwontgrok.blogspot.com/" target="_blank"&gt;Rob&lt;/a&gt;, to get a good overview. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2517604042882388393-6951624511840205488?l=martinsantics.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martinsantics.blogspot.com/feeds/6951624511840205488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://martinsantics.blogspot.com/2009/11/microsoft-net-exams.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/6951624511840205488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2517604042882388393/posts/default/6951624511840205488'/><link rel='alternate' type='text/html' href='http://martinsantics.blogspot.com/2009/11/microsoft-net-exams.html' title='Microsoft .NET Exams'/><author><name>Martin Evans</name><uri>http://www.blogger.com/profile/03846680744714184958</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_prPJEj560s4/StTdK81RjNI/AAAAAAAABDI/DtxLgrf0--Q/S220/Profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2517604042882388393.post-1133422685054637298</id><published>2009-10-20T16:43:00.002+01:00</published><updated>2010-03-07T20:27:46.417Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='StructureMap'/><category scheme='http://www.blogger.com/atom/ns#' term='Gotchas'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.Net MVC'/><title type='text'>Wiring Up The Membership Provider With StructureMap</title><content type='html'>&lt;p&gt;I spent yesterday retrofitting &lt;a title="Structure Map on SourceForge" href="http://structuremap.sourceforge.net/" rel="tag" target="_blank"&gt;StructureMap&lt;/a&gt; into an ASP.Net MVC site that I wrote earlier in the year. I ran into a number of minor issues that made me stop and think, and decided to post them here for future reference.&lt;/p&gt;  &lt;p&gt;I had already added a constructor to each of my controller classes that allowed services to be passed in as parameters (as it improves testability), so was pretty well prepared for letting StructureMap &lt;a title="AutoWiring services in StructureMap" href="h
