﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Michael Washington (ADefWebserver)</title>
    <description>All Open Source - All The Time</description>
    <link>http://www.openlightgroup.net/Blog/tabid/58/BlogId/1/Default.aspx</link>
    <language>en-US</language>
    <managingEditor>webmaster@openlightgroup.net</managingEditor>
    <webMaster>webmaster@adefwebserver.com</webMaster>
    <pubDate>Sat, 31 Jul 2010 19:23:21 GMT</pubDate>
    <lastBuildDate>Sat, 31 Jul 2010 19:23:21 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.5.1.19887</generator>
    <item>
      <title>Silverlight: Why I feel “Design Is The Most Important Thing”</title>
      <description>&lt;p&gt;My first experience with “Web Design” was around 1997. the DotCom thing was heating up and a client wanted to host a web site that was “Designed” by a “Internet Design Company” (that I swear was not in business even 10 days before). &lt;/p&gt;  &lt;p&gt;The problem was that the “page was taking too long to load”. I looked at what they did, and saw that while it was a beautiful page (yes, the “site” was only one page!), it was one big .gif file (and this is in the age of 2800 baud modems). &lt;/p&gt;  &lt;p&gt;What I did, was break up the parts of the image, into separate images laid out using tables (again this is before the .css gurus told us how evil that was). The “Site” loaded in a tenth of the time and I learned that “Designers are only good for making mock-ups, and only programmers know how to properly make web applications”.&lt;/p&gt;  &lt;p&gt;I hate to admit that this has been my attitude until this year. The year I ran into &lt;a href="http://www.codeproject.com/script/Membership/View.aspx?mid=7003572"&gt;Alan Beasley&lt;/a&gt;. Without intending to, he made a Programmer admit that Programmers are not in charge of the most important aspects of building truly great web applications, the Designers are.&lt;/p&gt;  &lt;h2&gt;The Silverlight Buttons&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image_thumb.png" width="418" height="87" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;It all started with a simple article Alan wrote on CodeProject.com: &lt;b&gt;&lt;a href="http://www.codeproject.com/KB/expression/ExpressionBlendButtons.aspx"&gt;Building Better Buttons in Expression Blend &amp; Silverlight&lt;/a&gt;. &lt;/b&gt;The point is that these were “just buttons”, but they were fun to press. I started to use his buttons in my articles, and I noticed that people were more impressed with pressing the buttons than they were with my code examples.&lt;/p&gt;  &lt;p&gt;I started to collaborate with Alan, and I watched people play with the PopUp in our &lt;a href="http://www.codeproject.com/KB/silverlight/MVVMPopUp.aspx"&gt;Popup article&lt;/a&gt; over and over again.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image_3.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image_thumb_3.png" width="154" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I would ask them “why do you like this so much?”, and they would respond, “I like the way it smoothly slides between yes and No”. &lt;/p&gt;  &lt;p&gt;It then hit me that Silverlight allows us to make applications that people find enjoyable to use. Perhaps it is the way a driver enjoys driving a finely crafted automobile. It doesn’t matter where you are going, it is just fun to drive.&lt;/p&gt;  &lt;p&gt;I was particularly taken by a small detail that Alan put into a &lt;a href="http://dnnsilverlight.adefwebserver.com/Silverlight40/SilverlightPortalFileManager/tabid/87/Default.aspx"&gt;File Manager application&lt;/a&gt; that I Programmed and he Designed.&lt;/p&gt;  &lt;table border="0" cellspacing="4" cellpadding="4" width="100"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="50"&gt;&lt;a href="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image_thumb_4.png" width="103" height="229" /&gt;&lt;/a&gt; &lt;/td&gt;        &lt;td valign="top" width="50"&gt;&lt;a href="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image_5.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image_thumb_5.png" width="97" height="225" /&gt;&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;In that one, the slider in the middle “pulses” when you hover over it. It practically begs you to slide it smoothly left and right. It is a small detail, but it says to the user “we know you exist, and we care about your experience”.&lt;/p&gt;  &lt;h2&gt;Designers Are A Pain!&lt;/h2&gt;  &lt;p&gt;All this comes at a price. Alan is a great guy, but he is after the best user experience, period. On a &lt;a href="http://www.codeproject.com/KB/silverlight/Wp7ViewModel.aspx"&gt;Windows Phone 7 tutorial&lt;/a&gt;, we spent two weeks, after I had completed all the coding, emailing back and forth resolving issues such a how he can transition from the list box to the video the way he wants.&lt;/p&gt;  &lt;p&gt;Actually, every single project runs into the same design related issues:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;“I want to be able to use a slider here…”&lt;/li&gt;    &lt;li&gt;“I need the ability to trigger an animation on this panel…”&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;It’s funny how I seem to be able  to create applications that work just fine, and there are only “issues” after he gets a hold of it! &lt;/p&gt;  &lt;p&gt;But, that the point, there IS a problem with the application. HE is the person who can SEE the problem. A single minded attention to the Design of an application, allows the application to be better Designed. After each “issue” is resolved, I have to admit that he is right. &lt;/p&gt;  &lt;p&gt;Look at my version of the File Manager:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image_thumb_6.png" width="385" height="226" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And look at his:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image_7.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image_thumb_7.png" width="388" height="255" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The code is exactly the same! &lt;/p&gt;  &lt;p&gt;But, it’s not just about “look”, it’s about “Design”. Look at my version of the Windows Phone application:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image_8.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image_thumb_8.png" width="397" height="246" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now look at his (again, the code is exactly the same):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image_9.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://silverlight.adefwebserver.com/blogimages/SilverlightWhyIfeelDesigniseverything_E7B0/image_thumb_9.png" width="395" height="240" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;His design not only looks better, it makes more sense. He addresses important issues, such as the spacing between the buttons, so people don’t accidently press the wrong button.&lt;/p&gt;  &lt;p&gt;Don’t get me started on how much agony he gave me over the issue with hooking up his version of the volume control. The entire time I am asking myself “WHY ME??”, until I see the final product and realize once again why it’s always worth it.&lt;/p&gt;  &lt;h2&gt;View Model / MVVM Is The Answer&lt;/h2&gt;  &lt;p&gt;Everything that Alan Beasley and I have done would not be possible without View Model. View Model, is basically MVVM without any of the “you should not do that”. View Model is about Designer Developer interaction, period.&lt;/p&gt;  &lt;p&gt;Silverlight allows Alan and I to have a separation of responsibilities. He is in charge of anything that ends with &lt;strong&gt;.xaml&lt;/strong&gt; (the UI) and I am in charge of anything that ends with &lt;strong&gt;.cs&lt;/strong&gt; (the code). He never messes up anything that I am doing, and don’t mess up his stuff. We can actually email files to each other that the other person can simply drop into their project and it just works.&lt;/p&gt;  &lt;p&gt;I feel that, the fact that a Designer can have complete control over the UI, means that Designers will work in Silverlight rather than another medium such as Flash. What artist wants to see their work “cut up” by some Programmer?&lt;/p&gt;  &lt;p&gt;It’s is not enough to teach Programmers how to do better Design. We need to give Designers “an equal place at the table”. Great applications will be created because we have “Diversity”. It’s not a “Team” if the Programmer is able to overrule everyone else, because every aspect of the application must go through the Programmer.&lt;/p&gt;  &lt;p&gt;When my programmer friends and I discuss different techniques to build Silverlight applications, the conversation usually gets to the “what would Alan Beasly think?” question. If he is not able to completely Design the UI with no coding, you lose your Designer. So unless we think Alan would “sign off on the solution”, we find another one. &lt;/p&gt;  &lt;h2&gt;The Programmers And The Chairs&lt;/h2&gt;  &lt;p&gt;Design is nice, but the most important thing? What about good architecture that is scalable and easily refactored ? These things are important, but the most important thing about any program, is the people who use it. A poorly designed application that has a great back end, is of little use if it does not perform the functions that the human being using it needs done. &lt;/p&gt;  &lt;p&gt;Let me illustrate my point with a story I call “The Programmers and the Chairs”:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The requirements were  clear. We only have trees to work with, and we have a lot of people, and they need something to sit on, because they get tired if they are standing up all the time. &lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;The first time the problem was solved, it was solved only by Programmers. Programmers are really smart people, and they figured out how to cut down trees, and they created tools to create chairs. And that is it, they created &lt;strong&gt;one&lt;/strong&gt; type of chair. It met the requirement. &lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;The next time, a team of Programmers and Designers was used. The Designers realized that sometimes chairs were needed that needed to be moved a lot, so they designed them to be lightweight. Other times the person using the chair needed to sit in it for long hours, so they made it adjustable to support their back.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;Please note that each time the Programmers were required to make these “Designs” actually work! “You want the chair the same size but lighter?” Whyyy meeee?? Hmm perhaps we can make the legs thinner…&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;And sometimes they wanted a chair so they can rock a nursing baby to sleep. This chair can also be easily rocked when they are older and want to watch their grandkids play in the yard. The Designers added contoured armrests and attractive patterns in the wood. Things that would appear to serve no purpose, other than the fact that this is a chair that a person will use as a cherished possession for decades.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This is the kind of application that I want to create.&lt;/p&gt;</description>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/112/Silverlight-Why-I-feel-ldquo-Design-Is-The-Most-Important-Thing-rdquo.aspx</link>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/112/Silverlight-Why-I-feel-ldquo-Design-Is-The-Most-Important-Thing-rdquo.aspx#Comments</comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/112/Silverlight-Why-I-feel-ldquo-Design-Is-The-Most-Important-Thing-rdquo.aspx</guid>
      <pubDate>Fri, 30 Jul 2010 02:53:21 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.openlightgroup.net/DesktopModules/Blog/Trackback.aspx?id=112</trackback:ping>
    </item>
    <item>
      <title>Raising a Button Click in a DataGrid using MVVM</title>
      <description>&lt;p&gt;&lt;a href="http://silverlight.adefwebserver.com/blogimages/RaisingaButtonClickinaDataGridusingMVVM_821C/clip_image001.jpg"&gt;&lt;img title="clip_image001" border="0" alt="clip_image001" width="228" height="128" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" src="http://silverlight.adefwebserver.com/blogimages/RaisingaButtonClickinaDataGridusingMVVM_821C/clip_image001_thumb.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I wanted to put a button that would set the current comment to “****” when the button was clicked. I am using View Model (MVVM) and normally you would need to resort to using code behind.&lt;/p&gt;
&lt;p&gt;Actually it is simple to do.&lt;/p&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/111/Raising-a-Button-Click-in-a-DataGrid-using-MVVM.aspx&gt;More...&lt;/a&gt;</description>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/111/Raising-a-Button-Click-in-a-DataGrid-using-MVVM.aspx</link>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/111/Raising-a-Button-Click-in-a-DataGrid-using-MVVM.aspx#Comments</comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/111/Raising-a-Button-Click-in-a-DataGrid-using-MVVM.aspx</guid>
      <pubDate>Sat, 24 Jul 2010 16:23:19 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.openlightgroup.net/DesktopModules/Blog/Trackback.aspx?id=111</trackback:ping>
    </item>
    <item>
      <title>Get a Free MSDN Ultimate subscription</title>
      <description>&lt;p&gt; &lt;/p&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/110/Get-a-Free-MSDN-Ultimate-subscription.aspx&gt;More...&lt;/a&gt;</description>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/110/Get-a-Free-MSDN-Ultimate-subscription.aspx</link>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/110/Get-a-Free-MSDN-Ultimate-subscription.aspx#Comments</comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/110/Get-a-Free-MSDN-Ultimate-subscription.aspx</guid>
      <pubDate>Mon, 12 Jul 2010 21:53:00 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.openlightgroup.net/DesktopModules/Blog/Trackback.aspx?id=110</trackback:ping>
    </item>
    <item>
      <title>Basic Silverlight View Model Validation</title>
      <description>&lt;p&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/1/109/WLW-BasicViewModelValidation_1077B-image_2.png"&gt;&lt;img title="image" border="0" alt="image" width="531" height="256" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" src="/Portals/0/Blog/Files/1/109/WLW-BasicViewModelValidation_1077B-image_thumb.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Live Sample:&lt;/strong&gt; &lt;a title="http://silverlight.adefwebserver.com/RIATasks2ABValidation/RIATasksWeb/" href="http://silverlight.adefwebserver.com/RIATasks2ABValidation/RIATasksWeb/"&gt;&lt;u&gt;&lt;font color="#800080"&gt;http://silverlight.adefwebserver.com/RIATasks2ABValidation/RIATasksWeb/&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There are many types of Silverlight Validation. This covers the most basic type, validating that the data entered matches the underlying type. In this example we will validate a Date Field.&lt;/p&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/109/Basic-Silverlight-View-Model-Validation.aspx&gt;More...&lt;/a&gt;</description>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/109/Basic-Silverlight-View-Model-Validation.aspx</link>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/109/Basic-Silverlight-View-Model-Validation.aspx#Comments</comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/109/Basic-Silverlight-View-Model-Validation.aspx</guid>
      <pubDate>Sun, 11 Jul 2010 04:54:11 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.openlightgroup.net/DesktopModules/Blog/Trackback.aspx?id=109</trackback:ping>
    </item>
    <item>
      <title>An ADO.NET Entity Framework / WCF 4.0 Version Of Silverlight CRUD</title>
      <description>&lt;p&gt;I decided to make a ADO.NET Entity Framework (EF) / Windows Communication Foundation (WCF) version of my tutorial: “&lt;a href="http://www.codeproject.com/KB/silverlight/RIATasks.aspx"&gt;RIATasks: A Simple Silverlight CRUD Example (using View Model and Rx Extensions)&lt;/a&gt;”. After doing so, I see that EF does not make much of a difference either way, but, while they have made great strides in easing deployment of WCF 4.0, major issues still remain.&lt;/p&gt;  &lt;h2&gt;ADO.NET Entity Framework&lt;/h2&gt;  &lt;p&gt;&lt;strong&gt;EF&lt;/strong&gt; could have been used without too much problem. It only took three minutes to convert the application from using &lt;strong&gt;Linq to SQL&lt;/strong&gt; to &lt;strong&gt;EF&lt;/strong&gt;. After using the wizard to create a .edmx file, I only had to make trivial changes to the Linq syntax. For example I changed this:&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; UpdateTask(Task objTask)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; strError = "&lt;span style="color: #8b0000"&gt;&lt;/span&gt;";
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        RIATasksDBDataContext DB = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RIATasksDBDataContext();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            var result = (from Tasks &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; DB.Tasks
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                            where Tasks.TaskID == objTask.TaskID
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                            where Tasks.UserID == GetCurrentUserID()
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                            select Tasks).FirstOrDefault();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (result != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                result.TaskDescription = objTask.TaskDescription;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                result.TaskName = objTask.TaskName;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                DB.SubmitChanges();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception ex)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            strError = ex.Message;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; strError;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    }&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To this:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; UpdateTask(Task objTask)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; strError = "&lt;span style="color: #8b0000"&gt;&lt;/span&gt;";
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; intCurrentUser = GetCurrentUserID();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        RIATasksEntities DB = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RIATasksEntities();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            var result = (from Tasks &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; DB.Tasks
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                            where Tasks.TaskID == objTask.TaskID
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                            where Tasks.UserID == intCurrentUser
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                            select Tasks).FirstOrDefault();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (result != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                result.TaskDescription = objTask.TaskDescription;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                result.TaskName = objTask.TaskName;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                DB.SaveChanges();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception ex)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            strError = ex.Message;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; strError;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    }&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The main reason I continue to use &lt;strong&gt;Linq to SQL&lt;/strong&gt; in most of my code examples is DotNetNuke works seamlessly with it and it does not with &lt;strong&gt;EF&lt;/strong&gt;. Also, &lt;strong&gt;Linq to SQL&lt;/strong&gt; is simple, it is very hard to mess it up. But, &lt;strong&gt;EF&lt;/strong&gt; would not have been a big deal to use instead of &lt;strong&gt;Linq to SQL&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;Windows Communication Foundation 4.0&lt;/h2&gt;

&lt;p&gt;Converting the .asmx web services to &lt;strong&gt;WCF&lt;/strong&gt; was not hard. it also took only three minutes. Mostly just changing the attribute on each web method from &lt;strong&gt;[WebMethod]&lt;/strong&gt; to&lt;strong&gt; [OperationContract]&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The main problem is that it automatically put a ton of stuff in the &lt;strong&gt;Web.config&lt;/strong&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;system.serviceModel&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;behaviors&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;      &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;serviceBehaviors&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;behavior&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;""&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;          &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;serviceMetadata&lt;/span&gt; &lt;span style="color: #ff0000"&gt;httpGetEnabled&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"true"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;          &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;serviceDebug&lt;/span&gt; &lt;span style="color: #ff0000"&gt;includeExceptionDetailInFaults&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"false"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;behavior&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;      &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;serviceBehaviors&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;behaviors&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;bindings&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;      &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;customBinding&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;binding&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"RIATasks.Web.WebService.customBinding0"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;          &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;binaryMessageEncoding&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;          &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;httpTransport&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;binding&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;      &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;customBinding&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;bindings&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;serviceHostingEnvironment&lt;/span&gt; &lt;span style="color: #ff0000"&gt;aspNetCompatibilityEnabled&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"true"&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;      &lt;span style="color: #ff0000"&gt;multipleSiteBindingsEnabled&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"true"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;services&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;      &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;service&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"RIATasks.Web.WebService"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;endpoint&lt;/span&gt; &lt;span style="color: #ff0000"&gt;address&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;""&lt;/span&gt; &lt;span style="color: #ff0000"&gt;binding&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"customBinding"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;bindingConfiguration&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"RIATasks.Web.WebService.customBinding0"&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;          &lt;span style="color: #ff0000"&gt;contract&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"RIATasks.Web.WebService"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;endpoint&lt;/span&gt; &lt;span style="color: #ff0000"&gt;address&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"mex"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;binding&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"mexHttpBinding"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;contract&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"IMetadataExchange"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;      &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;service&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;services&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;system.serviceModel&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;That is a lot of stuff that can go wrong as you move an application from environment to environment. Also this is just for one service, what if there are multiple services?&lt;/p&gt;

&lt;p&gt;According to the &lt;a href="http://msdn.microsoft.com/en-us/library/ee354381.aspx"&gt;documentation at this link&lt;/a&gt;, &lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;em&gt;…when you consider the net complexity of using WCF 3.x, one might reasonably conclude that it’s harder to use than its predecessor ASP.NET Web services (ASMX). With ASMX, you were able to define a [WebMethod] operation and the runtime automatically provided a default configuration for the underlying communications. When moving to WCF 3.x, on the other hand, developers have to know enough about the various WCF configuration options to define at least one endpoint. And the daunting number of configuration options often scares some developers away.&lt;/em&gt;&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;In an effort to make the overall WCF experience just as easy as ASMX, WCF 4 comes with a new “default configuration” model that completely removes the need for any WCF configuration. If you don’t provide any WCF configuration for a particular service, the WCF 4 runtime automatically configures your service with some standard endpoints and default binding/behavior configurations. This makes it much easier to get a WCF service up and running, especially for those who aren’t familiar with the various WCF configuration options and are happy to accept the defaults, at least to get started.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This goes a long way toward making things easier, however yank all the configuration stuff out of the &lt;strong&gt;web.config&lt;/strong&gt; (none of which is needed when using &lt;strong&gt;.asmx&lt;/strong&gt; web services) and you get helpful screen indicating that there is SOME configuration that is needed.&lt;/p&gt;

&lt;p&gt;Also, while WCF will now automatically configures a binding to a HTTP address, it only configures one. If I have a service at &lt;strong&gt;adefwebserver.com&lt;/strong&gt; and &lt;a href="http://www.adefwebserver.com"&gt;&lt;strong&gt;www.adefwebserver.com&lt;/strong&gt;&lt;/a&gt;, only one will work, the other will silently fail.&lt;/p&gt;

&lt;p&gt;One more thing, if you are deploying WCF on a Windows 2003 IIS web server, you have to ensure that your IIS settings &lt;a href="http://timheuer.com/blog/archive/2009/12/10/tips-to-deploy-ria-services-troubleshoot.aspx"&gt;specify only one authentication scheme&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;All of these settings are implemented by millions of people each day, but I hope you can understand why I omitted all this from a beginner’s tutorial. &lt;/p&gt;

&lt;p&gt;I am making the download available here:&lt;/p&gt;

&lt;p&gt;&lt;a title="http://silverlight.adefwebserver.com/files/RIATasksEF_WCFVersion.zip" href="http://silverlight.adefwebserver.com/files/RIATasksEF_WCFVersion.zip"&gt;http://silverlight.adefwebserver.com/files/RIATasksEF_WCFVersion.zip&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, I do not recommend using it because if you try to insert or update a large amount of text it will throw an error. I suspect it is a WCF configuration problem, but again the &lt;strong&gt;.asmx&lt;/strong&gt; web services work fine under the same conditions.&lt;/p&gt;</description>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/108/An-ADO-NET-Entity-Framework-WCF-4-0-Version-Of-Silverlight-CRUD.aspx</link>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/108/An-ADO-NET-Entity-Framework-WCF-4-0-Version-Of-Silverlight-CRUD.aspx#Comments</comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/108/An-ADO-NET-Entity-Framework-WCF-4-0-Version-Of-Silverlight-CRUD.aspx</guid>
      <pubDate>Mon, 28 Jun 2010 00:47:29 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.openlightgroup.net/DesktopModules/Blog/Trackback.aspx?id=108</trackback:ping>
    </item>
    <item>
      <title>A Simple Silverlight CRUD Example</title>
      <description>&lt;p&gt;&lt;img alt="" width="600" height="222" src="http://silverlight.adefwebserver.com/articles/simplesilverlightCRUD/img32.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Silverlight is different because it communicates with the website that launches it using &lt;a href="http://msdn.microsoft.com/en-us/library/cc838250%28VS.95%29.aspx#http_communication_scenarios_and_recommended_approaches"&gt;&lt;u&gt;&lt;font color="#0066cc"&gt;asynchronous communication&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;. Learning how to design applications this way can be a bit challenging.&lt;/p&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/106/A-Simple-Silverlight-CRUD-Example.aspx&gt;More...&lt;/a&gt;</description>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/106/A-Simple-Silverlight-CRUD-Example.aspx</link>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/106/A-Simple-Silverlight-CRUD-Example.aspx#Comments</comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/106/A-Simple-Silverlight-CRUD-Example.aspx</guid>
      <pubDate>Tue, 22 Jun 2010 04:16:43 GMT</pubDate>
      <slash:comments>6</slash:comments>
      <trackback:ping>http://www.openlightgroup.net/DesktopModules/Blog/Trackback.aspx?id=106</trackback:ping>
    </item>
    <item>
      <title>My MEF Rant</title>
      <description>&lt;p&gt;This is my MEF rant. Let me say up front that I do not think that Microsoft is doing anything incorrectly. But I have had a chance to spend at least 10 hours working with MEF so I now feel that I am educated enough about it to post a good old fashion rant.&lt;/p&gt;  &lt;h2&gt;What Is MEF?&lt;/h2&gt;  &lt;p&gt;The documentation for &lt;a href="http://codebetter.com/blogs/glenn.block/archive/2009/11/29/mef-has-landed-in-silverlight-4-we-come-in-the-name-of-extensibility.aspx"&gt;&lt;strong&gt;The Managed Extensibility Framework&lt;/strong&gt; (&lt;strong&gt;MEF&lt;/strong&gt;)&lt;/a&gt; describes its purpose as a tool that "&lt;a href="http://mef.codeplex.com/wikipage?title=Overview&amp;referringTitle=Home"&gt;...simplifies the creation of extensible applications&lt;/a&gt;". That is a very general statement. It's like describing nuclear physics as "the field of &lt;a href="http://en.wikipedia.org/wiki/Physics"&gt;physics&lt;/a&gt; that studies the building blocks and interactions of &lt;a href="http://en.wikipedia.org/wiki/Atomic_nuclei"&gt;atomic nuclei&lt;/a&gt;". In some ways MEF is as powerful to programming as nuclear physics is to science.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/1/104/WLW-MyMEFRant_FF8C-image_14.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="/Portals/0/Blog/Files/1/104/WLW-MyMEFRant_FF8C-image_thumb_6.png" width="346" height="70" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;I wrote an article that describes how you can use it to dynamically load a .xap file: &lt;a title="http://www.codeproject.com/KB/silverlight/MEFDynamicLoading.aspx" href="http://www.codeproject.com/KB/silverlight/MEFDynamicLoading.aspx"&gt;http://www.codeproject.com/KB/silverlight/MEFDynamicLoading.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;h2&gt;Mef = Good? or Why Should You Want To Use It?&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/1/104/WLW-MyMEFRant_FF8C-image_12.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="/Portals/0/Blog/Files/1/104/WLW-MyMEFRant_FF8C-image_thumb_5.png" width="330" height="278" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I have a article that I am working on that allows you to use &lt;strong&gt;MEF&lt;/strong&gt; to dynamically load different versions of a Video Player. The main project is in a file called &lt;strong&gt;SkinableVideoPlayer.xap&lt;/strong&gt; and it is the first project to load. &lt;/p&gt;  &lt;p&gt;It uses &lt;strong&gt;MEF&lt;/strong&gt; to load the custom video players that are contained in &lt;strong&gt;.xaps&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/1/104/WLW-MyMEFRant_FF8C-image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="/Portals/0/Blog/Files/1/104/WLW-MyMEFRant_FF8C-image_thumb.png" width="244" height="78" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;When you normally build the project the &lt;strong&gt;.xap&lt;/strong&gt; size for the custom video player is about &lt;strong&gt;466 kb&lt;/strong&gt;. &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/1/104/WLW-MyMEFRant_FF8C-image_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="/Portals/0/Blog/Files/1/104/WLW-MyMEFRant_FF8C-image_thumb_1.png" width="458" height="312" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;We can change the name of the &lt;strong&gt;.xap&lt;/strong&gt; file to .zip, and open it up, we see that the only file we really need, is the customized player that is is only &lt;strong&gt;6 kb&lt;/strong&gt;. &lt;/p&gt;  &lt;p&gt;All the other files are assemblies that are referenced by the custom video player.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/1/104/WLW-MyMEFRant_FF8C-image_6.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="/Portals/0/Blog/Files/1/104/WLW-MyMEFRant_FF8C-image_thumb_2.png" width="281" height="427" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;First we make sure that the main project, &lt;strong&gt;SkinableVideoPlayer&lt;/strong&gt;, has a reference to all the assemblies that we will need, then we go to references in the custom video player, and set all of them to &lt;strong&gt;Copy Local = False&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/1/104/WLW-MyMEFRant_FF8C-image_8.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="/Portals/0/Blog/Files/1/104/WLW-MyMEFRant_FF8C-image_thumb_3.png" width="244" height="79" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now, when we build the size of the &lt;strong&gt;.xap&lt;/strong&gt; is only &lt;strong&gt;6 kb&lt;/strong&gt;!&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Wow!&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Ok sign me up and give me a T-Shirt, and a membership card, to the &lt;strong&gt;I LOVE MEF!&lt;/strong&gt; fan club. I’m sold. &lt;/p&gt;  &lt;p&gt;With a Silverlight application, reducing the file size and dynamically loading components only when needed is a very BIG DEAL.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt; Please understand that MEF can only work this “magic” if the required assemblies are loaded (Copy Local is set to True) by another &lt;strong&gt;.xap&lt;/strong&gt; &lt;u&gt;before it is needed&lt;/u&gt;. In my case this &lt;strong&gt;.xap&lt;/strong&gt; is the &lt;strong&gt;SkinableVideoPlayer.xap&lt;/strong&gt;, and as you can see in the screen shots above, it is still a hefty 488kb because it DOES contain the assemblies. &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;My point is that without MEF I was forced to load the &lt;strong&gt;SkinableVideoPlayer.xap&lt;/strong&gt; at &lt;strong&gt;488 kb&lt;/strong&gt; AND the &lt;strong&gt;Hiro.xap&lt;/strong&gt; for an additional &lt;strong&gt;466 kb&lt;/strong&gt;. In my article I plan to have about 4 players and it would be a 488 kb hit each time. Using MEF I only need to load 24 kb for all 4 players rather than 2330 kb. Unless my math is wrong that is a 97% reduction.&lt;/em&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;h2&gt;What Is Missing?&lt;/h2&gt;  &lt;p&gt;Once you understand MEF it’s not that hard, but it STAYS complicated. It is very powerful and anything powerful is inherently complex. However, anything complex can be simplified.&lt;/p&gt;  &lt;p&gt;It should not take hundreds of words and dozens of screen shots to explain how to dynamically load a .xap file. This reminds me of the time when web services were first introduced. you had to create your web proxys manually. That has now been replaced by a simple “Add Web Reference” in Visual Studio.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;h2&gt;What I Want To See&lt;/h2&gt;  &lt;p&gt;It is standard procedure for Microsoft to release something in it’s most basic form, then progressively enhance it according to customer feedback. MEF is in the middle of that process. Things are progressing according to plan.&lt;/p&gt;  &lt;p&gt;Well here is some “Customer Feedback” :)&lt;/p&gt;  &lt;p&gt;So what I want Microsoft to add, is something like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/1/104/WLW-MyMEFRant_FF8C-image_16.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="/Portals/0/Blog/Files/1/104/WLW-MyMEFRant_FF8C-image_thumb_7.png" width="244" height="110" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;1) The ability to right-click in Visual Studio to set a "MEF Reference" that will automatically note the assemblies in the project that I am adding and set them to copy Local=False if the parent project already has them    &lt;br /&gt;2) Then it shows me the referenced projects in a window and I can drag and drop them directly onto the Design surface and it will automatically write all the code.     &lt;br /&gt;3) I can also interact with it in code behind. &lt;/p&gt;  &lt;p&gt;Basically give me the same experience I have with web services :)&lt;/p&gt;</description>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/104/My-MEF-Rant.aspx</link>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/104/My-MEF-Rant.aspx#Comments</comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/104/My-MEF-Rant.aspx</guid>
      <pubDate>Sat, 12 Jun 2010 17:05:24 GMT</pubDate>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.openlightgroup.net/DesktopModules/Blog/Trackback.aspx?id=104</trackback:ping>
    </item>
    <item>
      <title>Expression Blend Number Guesser using DataStore</title>
      <description>&lt;h2&gt;Expression Blend DataStore - A Powerful Tool For Designers&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt="http://silverlight.adefwebserver.com/ExpressionBlendNumberGuesser/CodeProjectArticle/BlendNumberGuesser/img36.jpg" src="http://silverlight.adefwebserver.com/ExpressionBlendNumberGuesser/CodeProjectArticle/BlendNumberGuesser/img36.jpg" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Live example: &lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Link: &lt;a href="http://silverlight.adefwebserver.com/ExpressionBlendNumberGuesser/"&gt;&lt;u&gt;&lt;font color="#800080"&gt;Expression Blend Number Guesser&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Microsoft Expression Blend 4&lt;/strong&gt;+ provides a tool called &lt;strong&gt;DataStore&lt;/strong&gt;. It is a very powerful tool for Designers to create functionality in Expression Blend without writing any code. To demonstrate some of it's abilities, I created a number guessing program with no code.&lt;/p&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/103/Expression-Blend-Number-Guesser-using-DataStore.aspx&gt;More...&lt;/a&gt;</description>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/103/Expression-Blend-Number-Guesser-using-DataStore.aspx</link>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/103/Expression-Blend-Number-Guesser-using-DataStore.aspx#Comments</comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/103/Expression-Blend-Number-Guesser-using-DataStore.aspx</guid>
      <pubDate>Mon, 31 May 2010 18:58:00 GMT</pubDate>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.openlightgroup.net/DesktopModules/Blog/Trackback.aspx?id=103</trackback:ping>
    </item>
    <item>
      <title>Simple Example To Secure WCF Data Service OData Methods</title>
      <description>&lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/images/OdataAuthentication.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Live Example:&lt;/strong&gt; &lt;a title="http://silverlight.adefwebserver.com/ODataAuthenticationSample/" href="http://silverlight.adefwebserver.com/ODataAuthenticationSample/"&gt;&lt;u&gt;&lt;font color="#800080"&gt;http://silverlight.adefwebserver.com/ODataAuthenticationSample/&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So you want to use &lt;strong&gt;OData &lt;/strong&gt;but you need to secure the data? There are a ton of ways to do this, but this covers a simple way using &lt;strong&gt;ASP.NET Forms Authentication&lt;/strong&gt;.&lt;/p&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/100/Simple-Example-To-Secure-WCF-Data-Service-OData-Methods.aspx&gt;More...&lt;/a&gt;</description>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/100/Simple-Example-To-Secure-WCF-Data-Service-OData-Methods.aspx</link>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/100/Simple-Example-To-Secure-WCF-Data-Service-OData-Methods.aspx#Comments</comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/100/Simple-Example-To-Secure-WCF-Data-Service-OData-Methods.aspx</guid>
      <pubDate>Sat, 22 May 2010 19:50:21 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.openlightgroup.net/DesktopModules/Blog/Trackback.aspx?id=100</trackback:ping>
    </item>
    <item>
      <title>Simple Silverlight 4 Example Using oData and RX Extensions</title>
      <description>&lt;p&gt;This is part II to the previous Blog (&lt;a href="http://www.openlightgroup.nethttp://www.openlightgroup.net/Blog/tabid/58/EntryId/98/OData-Simplified.aspx"&gt;http://openlightgroup.nethttp://www.openlightgroup.nethttp://www.openlightgroup.net/Blog/tabid/58/EntryId/98/OData-Simplified.aspx&lt;/a&gt;) where we looked a simple &lt;strong&gt;OData&lt;/strong&gt; example. This time we will make a simple Silverlight application that talks to an &lt;strong&gt;oData&lt;/strong&gt; service.&lt;/p&gt; &lt;p&gt;Note, for this tutorial, you will also need to download and install &lt;strong&gt;RX Extensions&lt;/strong&gt; from: &lt;a href="http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx"&gt;http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx&lt;/a&gt;, and the &lt;strong&gt;Silverlight Toolkit &lt;/strong&gt;from: &lt;a href="http://silverlight.codeplex.com"&gt;http://silverlight.codeplex.com&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;As with the last tutorial, we will not use a database, just a simple collection that we are creating programmatically. This will allow you to see just the &lt;strong&gt;oData&lt;/strong&gt; parts.&lt;/p&gt; &lt;p&gt;First, open up the project, in Visual Studio 2010 (or higher), from the zip file at the bottom of &lt;a href="http://www.openlightgroup.nethttp://www.openlightgroup.net/Blog/tabid/58/EntryId/98/OData-Simplified.aspx"&gt;this link&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/img3.jpg"&gt;&lt;/p&gt; &lt;p&gt;Select &lt;strong&gt;Add&lt;/strong&gt; then &lt;strong&gt;New Project...&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/img7.jpg"&gt;&lt;/p&gt; &lt;p&gt;Create a new &lt;strong&gt;Silverlight Application&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/img8.jpg"&gt;&lt;/p&gt; &lt;p&gt;Add a &lt;strong&gt;Service Reference&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/imgA.jpg"&gt;&lt;/p&gt; &lt;p&gt;Click &lt;strong&gt;Discover&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/imgB.jpg"&gt;&lt;/p&gt; &lt;p&gt;Create a reference called &lt;strong&gt;wsSampleCustomerData&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/img18.jpg"&gt;&lt;/p&gt; &lt;p&gt;Next, add assembly references in your Silverlight project to:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;System.CoreEx  &lt;li&gt;System.Observable  &lt;li&gt;System.Reactive &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/imgD.jpg"&gt;&lt;/p&gt; &lt;p&gt;In the Silverlight project, delete the &lt;strong&gt;MainPage.xaml&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/imgF.jpg"&gt;&lt;/p&gt; &lt;p&gt;Open the project in &lt;strong&gt;Expression Blend 4&lt;/strong&gt; (or higher).&lt;/p&gt; &lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/img10.jpg"&gt;&lt;/p&gt; &lt;p&gt;In &lt;strong&gt;Expression Blend&lt;/strong&gt;, Select &lt;strong&gt;File&lt;/strong&gt; then &lt;strong&gt;New Item...&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/img11.jpg"&gt;&lt;/p&gt; &lt;p&gt;Select the &lt;strong&gt;UserControl with ViewModel&lt;/strong&gt; template, and create a file called &lt;strong&gt;MainPage.xaml&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/img12.jpg"&gt;&lt;/p&gt; &lt;p&gt;It will create the &lt;strong&gt;ViewModel&lt;/strong&gt; pages (MainPage.xaml and MainPage.xaml.cs with a MainPageModel.cs View Model page that is already wired-up).&lt;/p&gt; &lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/img14.jpg"&gt;&lt;/p&gt; &lt;p&gt;Create a folder called &lt;strong&gt;Model&lt;/strong&gt; and a class called &lt;strong&gt;Model.cs&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;Replace all the code with the following code:&lt;/p&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Linq;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; SilverlightODataSample.wsSampleCustomerData;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Data.Services.Client;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; SilverlightODataSample
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;{
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Model
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        #region GetCustomers
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; IObservable&lt;IEvent&lt;LoadCompletedEventArgs&gt;&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            GetCustomers(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; intPage)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// Create a URI that points to the OData Service&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            Uri objUri = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Uri(GetBaseAddress(), UriKind.RelativeOrAbsolute);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// Set up oData service call&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            SampleDataSource SDS = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SampleDataSource(objUri);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// Construct a Query&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            var query = (from SampleCustomerData &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; SDS.SampleCustomerData
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                         where SampleCustomerData.CustomerNotes.Contains("&lt;span style="color: #8b0000"&gt;3&lt;/span&gt;")
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                         select SampleCustomerData).Skip(intPage).Take(10);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// Set up a DataServiceCollection to hold the results&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            DataServiceCollection&lt;CustomerRecord&gt; CustomerRecords = 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DataServiceCollection&lt;CustomerRecord&gt;();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// Set up a Rx Observable (in a variable called observable) &lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// that will contain the results of&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// the "LoadCompleted" event that CustomerRecords will fire&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// When LoadAsync(query) is fired in the following stetement&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            IObservable&lt;IEvent&lt;LoadCompletedEventArgs&gt;&gt; observable =
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                Observable.FromEvent&lt;LoadCompletedEventArgs&gt;(CustomerRecords,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                "&lt;span style="color: #8b0000"&gt;LoadCompleted&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// Execute the LoadAsync on CustomerRecords passing&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// the query that was constructed earlier&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            CustomerRecords.LoadAsync(query);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// Return observable&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; observable;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        #endregion
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        #region GetBaseAddress
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; GetBaseAddress()
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// This gets the address of the webservice by &lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// getting the AbsoluteUri and then stripping out the &lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// name of the .xap file&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; strXapFile = @"&lt;span style="color: #8b0000"&gt;/ClientBin/SilverlightODataSample.xap&lt;/span&gt;";
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; strBaseWebAddress =
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                App.Current.Host.Source.AbsoluteUri.Replace(strXapFile, "&lt;span style="color: #8b0000"&gt;&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(@"&lt;span style="color: #8b0000"&gt;{0}/{1}&lt;/span&gt;", strBaseWebAddress, @"&lt;span style="color: #8b0000"&gt;Service.svc&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        #endregion
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;&lt;pre&gt; &lt;/pre&gt;
&lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/img33.jpg"&gt;&lt;/p&gt;
&lt;p&gt;Open &lt;strong&gt;MainPageModel.cs&lt;/strong&gt; and replace all the code with the following code:&lt;/p&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.ComponentModel;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.ObjectModel;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; SilverlightODataSample.wsSampleCustomerData;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Data.Services.Client;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; SilverlightODataSample
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;{
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; MainPageModel : INotifyPropertyChanged
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; MainPageModel()
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// When the Control loads&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// Get the Customers&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            GetCustomers();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        #region GetCustomers
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; GetCustomers()
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// Call the Model to get the Customers&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// Passing in 0 to get the first page&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// Paging could easily be done here&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;// You could also pass in other criteria&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            Model.GetCustomers(0).Subscribe(p =&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                &lt;span style="color: #008000"&gt;// Check for an error in the Service&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (p.EventArgs.Error == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                    &lt;span style="color: #008000"&gt;// loop thru each item in the&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                    &lt;span style="color: #008000"&gt;// DataServiceCollection&lt;CustomerRecord&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                    &lt;span style="color: #008000"&gt;// Collection&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                    &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (CustomerRecord Customer &lt;span style="color: #0000ff"&gt;in&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                        (DataServiceCollection&lt;CustomerRecord&gt;)p.Sender)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                        &lt;span style="color: #008000"&gt;// Add to the Customer to the colCustomerRecord &lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                        &lt;span style="color: #008000"&gt;// Collection so the View can bind to it&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                        colCustomerRecord.Add(Customer);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                    }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            });
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        #endregion
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        #region CustomerRecord
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #008000"&gt;// The View will bind to this collection and automatically be notified if &lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #008000"&gt;// The collection changes. The Designer can bind any UI element that &lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #008000"&gt;// can hold a collection&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; ObservableCollection&lt;CustomerRecord&gt; _colCustomerRecord
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ObservableCollection&lt;CustomerRecord&gt;();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ObservableCollection&lt;CustomerRecord&gt; colCustomerRecord
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; _colCustomerRecord; }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (colCustomerRecord == &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                _colCustomerRecord = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.NotifyPropertyChanged("&lt;span style="color: #8b0000"&gt;colCustomerRecord&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        #endregion
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        #region INotifyPropertyChanged
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #008000"&gt;// This is a supporting method to raise a notification for any&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #008000"&gt;// Element that is subscribed to a Property that implements&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #008000"&gt;// NotifyPropertyChanged&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;event&lt;/span&gt; PropertyChangedEventHandler PropertyChanged;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; NotifyPropertyChanged(String info)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (PropertyChanged != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                PropertyChanged(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; PropertyChangedEventArgs(info));
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        #endregion
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/img4.jpg"&gt;&lt;/p&gt;
&lt;p&gt;Grab a &lt;strong&gt;DataGrid&lt;/strong&gt; and drop it on the design surface.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/img5.jpg" width="400" height="316"&gt;&lt;/p&gt;
&lt;p&gt;Widen it so it fills the page.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/img1C.jpg"&gt;&lt;/p&gt;
&lt;p&gt;Click on the &lt;strong&gt;Data&lt;/strong&gt; tab so that you see the &lt;strong&gt;Data Context&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/img9.gif"&gt;&lt;/p&gt;
&lt;p&gt;Drag and drop &lt;strong&gt;colCustomerRecord&lt;/strong&gt; collection onto the &lt;strong&gt;DataGrid&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://silverlight.adefwebserver.com/SilverlightODataSample/imgD1.jpg"&gt;&lt;/p&gt;
&lt;p&gt;Build and run the project.&lt;/p&gt;
&lt;p&gt;OData and RX extensions are pretty impressive:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;RX extensions were used because it decouples the oData Service calls from the View Model. This allows the methods in the model to be easily called by multiple View Models. 
&lt;li&gt;We are only grabbing the first page of the results but we could easily implement paging by passing the page number to the method 
&lt;li&gt;We are also only creating a simple query. We could easily create a more complex query of the oData Service &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Download the Code&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Download the Code here: &lt;a href="http://silverlight.adefwebserver.com/SilverlightODataSample/ODataSample.zip"&gt;ODataSample.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Further Reading&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.leastprivilege.com/ThinktectureIdentityModelWIFSupportForWCFRESTServicesAndOData.aspx"&gt;http://www.leastprivilege.com/ThinktectureIdentityModelWIFSupportForWCFRESTServicesAndOData.aspx&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/99/Simple-Silverlight-4-Example-Using-oData-and-RX-Extensions.aspx</link>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/99/Simple-Silverlight-4-Example-Using-oData-and-RX-Extensions.aspx#Comments</comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/99/Simple-Silverlight-4-Example-Using-oData-and-RX-Extensions.aspx</guid>
      <pubDate>Thu, 20 May 2010 04:15:40 GMT</pubDate>
      <slash:comments>8</slash:comments>
      <trackback:ping>http://www.openlightgroup.net/DesktopModules/Blog/Trackback.aspx?id=99</trackback:ping>
    </item>
  </channel>
</rss>