<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Brad Abrams </title><link>http://blogs.msdn.com/b/brada/</link><description>Design Guidelines, Managed code and the .NET Framework</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>My Last Day at Microsoft</title><link>http://blogs.msdn.com/b/brada/archive/2010/04/20/my-last-day-at-microsoft.aspx</link><pubDate>Tue, 20 Apr 2010 17:51:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9999363</guid><dc:creator>BradA</dc:creator><slash:comments>123</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9999363</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/04/20/my-last-day-at-microsoft.aspx#comments</comments><description>&lt;p&gt;Wow – I can’t believe it has already been 13 years at Microsoft.&amp;#160; I have had a great time here and learned so much from the smart and passionate people I work with as well as the incredible developer community around .NET.&amp;#160; But I have decided it is time for me to try something new – so my last day at Microsoft will be Friday, April 23rd .&amp;#160; &lt;/p&gt;  &lt;p&gt;While I am leaving Microsoft, I continue to have a positive view of the company.&amp;#160;&amp;#160; No other company has the footprint that Microsoft does on the industry.&amp;#160;&amp;#160; I am confident that the company will continue to have an impact in the years to come.&amp;#160;&amp;#160; I will be looking forward to watching the next release of .NET from outside.&amp;#160; &lt;/p&gt;  &lt;p&gt;Of course, there is never a good time to leave, but I feel a great sense of accomplishment shipping Silverlight 4 and Visual Studio 2010/.NET Framework 4.&amp;#160; The technologies I have been most closely involved with have found amazingly good homes.&amp;#160; MEF and RIA Services are in the right teams and on the right track long term and I believe those technologies will have great futures.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;What I loved most about my time at Microsoft is the opportunity to work with some of the smartest, most passionate people in the industry to ship some great software that customers LOVE.&amp;#160;&amp;#160; As I have been thinking about this transition, I have reflected on a few of the releases I have been a part of and what I learned in the process.&amp;#160;&amp;#160;&amp;#160;&amp;#160; Hopefully you can take these learnings as my last words of wisdom to you.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;MS-Travel&lt;/b&gt;&amp;#160; (later spun off as &lt;a href="http://www.expedia.com/"&gt;Expedia&lt;/a&gt; )&amp;#160; - My first experience at Microsoft as an intern in Test.&amp;#160; I landed the job because I was able to help my future boss debug a VB issue in the interview ;-).&amp;#160; I learned what it was to be a PM and I fell in LOVE with it.&amp;#160; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;VB 5&lt;/b&gt;&amp;#160; - I came back the next summer as a PM intern and found my sweet spot – PM in the developer space.&amp;#160; I was a PM on the Control Creation Edition of VB 5 and learned the blocking and tackling of consensus building, prioritization and specing!&amp;#160; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;IE4 and&amp;#160; IE4.01 with Win98&lt;/b&gt; -&amp;#160; It was so energizing to be involved in the first browser wars.&amp;#160;&amp;#160; At the time, I think we had IE4, 5 and 6 all going in parallel!&amp;#160;&amp;#160; As Release PM I learned a ton about shipping: balancing priorities, triaging, war rooms, and working very broadly across teams.&amp;#160; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Common Language Runtime (“Lightning”) and overall .NET Framework (“Project 42”)&lt;/b&gt;.&amp;#160; In the 4+ years incubating the first release I got my taste for “doing a V1” and I loved it!&amp;#160; We all *&lt;b&gt;knew&lt;/b&gt;* we were changing the industry with our work as much as we knew the project could be canceled at any time.&amp;#160; After PDC2000, when we came out of the veil of secrecy, I learned about how to listen to customers and got hooked on bringing customer feedback into the product with the &lt;a href="mailto:DOTNET@DISCUSS.DEVELOP.COM"&gt;DOTNET@DISCUSS.DEVELOP.COM&lt;/a&gt; email list.&amp;#160; If you were on that email list at the time, you helped shape what become the glasnost of Microsoft that lead to weblogs.asp.net, blogs.msdn.com, and eventually channel 9 and the whole community arm of MS.&amp;#160;&amp;#160;&amp;#160; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;.NET Framework 1.1&amp;#160;&amp;#160; (“Everett” ) &lt;/b&gt;and &lt;b&gt;.NET Framework 2.0 (“Whidbey”)&amp;#160; &lt;/b&gt;- Between these two releases, I learned about the “V2 trap”.&amp;#160; That is, the critical importance of having a clear vision for a release rather than just “make stuff better”.&amp;#160;&amp;#160; It is so much more valuable to customers, and therefore more satisfying for engineers,&amp;#160; to work on “3-big bets” rather than peanut-buttering our efforts over a bunch of small “rounding out” features.&amp;#160; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;.NET Framework 3.0 with Windows Vista (“WinFX”)&amp;#160; – &lt;/b&gt;Back to my “V1.0 passions”, with this release we aimed to make .NET the most important programming model for Windows.&amp;#160; With broad new technologies, WF, WinFS, WCF and WPF there was a LOT of new stuff.&amp;#160; I was asked to bringing this work together to a coherent whole.&amp;#160; I learned a TON about how to develop software at scale and what works (and doesn’t) across such a large organization. This experience also gave me much deeper insight into executive decision making and what works (and doesn’t) to get the most effective decisions made.&amp;#160;&amp;#160; &lt;b&gt;&lt;/b&gt;&lt;/li&gt;    &lt;li&gt;&lt;b&gt;ASP.NET 3.5, ASP.NET AJAX&lt;/b&gt; &lt;b&gt;and ASP.NET MVC&lt;/b&gt; – I learned a whole new development area – AJAX and the web.&amp;#160; This time lit my passion for the web development area that I continue to believe is a game changer.&amp;#160;&amp;#160; I learned the value of shipping out of band releases to clearly address customer scenarios as they emerge.&amp;#160; I also learned the value of small, lightweight (download size, concept count, etc) frameworks.&amp;#160; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Silverlight 2, 3 and now 4&lt;/b&gt; –&lt;b&gt; &lt;/b&gt;That rate of maturation of Silverlight has been amazing.&amp;#160; From the first release where there was literally no button, to Silverlight 4 where we have a viable line of business platform.&amp;#160; Here I learned a lot about how to do small, frequent,&amp;#160; incremental releases.&amp;#160;&amp;#160; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;MEF&lt;/b&gt; – This technology has a huge potential to change the core patterns the average .NET Developer uses to build their applications. Through this release, I learned two big things:&amp;#160; The value of a close customer (eg VS) shaping and guiding requirements and how to work diligently with the community in a very transparent way (shipping source, open license, etc).&amp;#160;&amp;#160;&amp;#160; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;WCF RIA Services &lt;/b&gt; - The thing I love about RIA Services is that we tackled an end-to-end customer scenario that crossed database, mid-tier, client and tooling to deliver really compelling customer value.&amp;#160;&amp;#160; While this sort of end-to-end thinking forced us to work very closely with many teams, the results were fantastic!&amp;#160;&amp;#160; Out of this release I learned the value of focusing on the end-to-end rather than just one small island. &lt;b&gt;&lt;/b&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I am deeply grateful for the opportunities I have had at Microsoft in working with such an amazing set of co-workers and vibrant community.&lt;/p&gt;  &lt;p&gt;Initially, I am going to take some time off to enjoy the wonderful spring weather in Seattle and visit Legoland with the kids before starting my next endeavor.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;While I will not be as deeply involved in the .NET Developer Community – I will be keeping up and enjoying the successes I know you will have.&amp;#160;&amp;#160;&amp;#160; Good luck and have a great time!&amp;#160; &lt;/p&gt;  &lt;p&gt;I’d love to stay in touch:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Email: &lt;a href="mailto:BradA42@gmail.com"&gt;BradA42@gmail.com&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Blog: &lt;a href="http://bradabrams.com"&gt;http://bradabrams.com&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Twitter&lt;a href="http://twitter.com/brada"&gt;: @BradA&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Facebook:&amp;#160; &lt;a href="http://www.facebook.com/profile.php?ref=profile&amp;amp;id=650776263#!/profile.php?id=650776263"&gt;Brad Abrams&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9999363" width="1" height="1"&gt;</description></item><item><title>Silverlight 4 + RIA Services - Ready for Business: Ajax Endpoint</title><link>http://blogs.msdn.com/b/brada/archive/2010/04/12/silverlight-4-ria-services-ready-for-business-ajax-endpoint.aspx</link><pubDate>Mon, 12 Apr 2010 16:13:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9979102</guid><dc:creator>BradA</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9979102</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/04/12/silverlight-4-ria-services-ready-for-business-ajax-endpoint.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx"&gt;Continuing in our series&lt;/a&gt;, I wanted to touch on how a RIA Services can be exposed&amp;#160; your service in &lt;a href="http://json.org/"&gt;JSON&lt;/a&gt;.&amp;#160; This is very handy for Ajax clients. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The great thing is that enabling the JSON endpoint is that it requires NO changes whatsoever to the DomainService.&amp;#160; All you need to do is enable it is to add the JSON endpoint in web.config&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  1:   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;system.serviceModel&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  2:     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;domainServices&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  3:       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;endpoints&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  4:         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;JSON&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  5:              &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Microsoft.ServiceModel.DomainServices.Hosting.JsonEndpointFactory, Microsoft.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  6:         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;OData&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  7:              &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;System.ServiceModel.DomainServices.Hosting.ODataEndpointFactory, System.ServiceModel.DomainServices.Hosting.OData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  8:         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Soap&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  9:              &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Microsoft.ServiceModel.DomainServices.Hosting.SoapXmlEndpointFactory, Microsoft.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 10:       &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;endpoints&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 11:     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;domainServices&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 12: &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;As you can see, this above snippet shows adding the JSON endpoint from the &lt;a href="http://silverlight.net/riaservices/"&gt;RIA Services toolkit&lt;/a&gt; as well as the OData and Soap ones.&amp;#160; &lt;/p&gt;

&lt;p&gt;You can see the endpoint results navigate to the URL in this format:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://localhost:21516/BusinessApplication1-web-DishViewDomainService.svc/Json/GetRestaurants"&gt;http://localhost:21516/BusinessApplication1-web-DishViewDomainService.svc/Json/GetRestaurants&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessA_EA89/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessA_EA89/image_thumb.png" width="478" height="221" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&amp;quot;&lt;span style="color: #8b0000"&gt;GetRestaurantsResult&lt;/span&gt;&amp;quot;:{&amp;quot;&lt;span style="color: #8b0000"&gt;TotalCount&lt;/span&gt;&amp;quot;:-2,&amp;quot;&lt;span style="color: #8b0000"&gt;IncludedResults&lt;/span&gt;&amp;quot;:[],
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&amp;quot;&lt;span style="color: #8b0000"&gt;RootResults&lt;/span&gt;&amp;quot;:[{&amp;quot;&lt;span style="color: #8b0000"&gt;Address&lt;/span&gt;&amp;quot;:&amp;quot;&lt;span style="color: #8b0000"&gt;49 Gilbert St.&lt;/span&gt;&amp;quot;,&amp;quot;&lt;span style="color: #8b0000"&gt;City&lt;/span&gt;&amp;quot;:&amp;quot;&lt;span style="color: #8b0000"&gt;London&lt;/span&gt;&amp;quot;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&amp;quot;&lt;span style="color: #8b0000"&gt;ContactName&lt;/span&gt;&amp;quot;:&amp;quot;&lt;span style="color: #8b0000"&gt;Charlotte Cooper&lt;/span&gt;&amp;quot;,&amp;quot;&lt;span style="color: #8b0000"&gt;ContactTitle&lt;/span&gt;&amp;quot;:&amp;quot;&lt;span style="color: #8b0000"&gt;Purchasing Manager&lt;/span&gt;&amp;quot;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&amp;quot;&lt;span style="color: #8b0000"&gt;Fax&lt;/span&gt;&amp;quot;:&amp;quot;&lt;span style="color: #8b0000"&gt;(171) 555-2222&lt;/span&gt;&amp;quot;,&amp;quot;&lt;span style="color: #8b0000"&gt;HomePage&lt;/span&gt;&amp;quot;:&amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;,&amp;quot;&lt;span style="color: #8b0000"&gt;ID&lt;/span&gt;&amp;quot;:1,&amp;quot;&lt;span style="color: #8b0000"&gt;ImagePath&lt;/span&gt;&amp;quot;:
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&amp;quot;&lt;span style="color: #8b0000"&gt;Restaurant_Alinea.jpg&lt;/span&gt;&amp;quot;,&amp;quot;&lt;span style="color: #8b0000"&gt;Name&lt;/span&gt;&amp;quot;:&amp;quot;&lt;span style="color: #8b0000"&gt;Alinea - Updated from Ajax&lt;/span&gt;&amp;quot;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&amp;quot;&lt;span style="color: #8b0000"&gt;Phone&lt;/span&gt;&amp;quot;:&amp;quot;&lt;span style="color: #8b0000"&gt;(171) 555-2222&lt;/span&gt;&amp;quot;,&amp;quot;&lt;span style="color: #8b0000"&gt;PostalCode&lt;/span&gt;&amp;quot;:&amp;quot;&lt;span style="color: #8b0000"&gt;EC1 4SD&lt;/span&gt;&amp;quot;,&amp;quot;&lt;span style="color: #8b0000"&gt;Region&lt;/span&gt;&amp;quot;:&amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;},
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&amp;quot;&lt;span style="color: #8b0000"&gt;Address&lt;/span&gt;&amp;quot;:&amp;quot;&lt;span style="color: #8b0000"&gt;P.O. Box 78934&lt;/span&gt;&amp;quot;,&amp;quot;&lt;span style="color: #8b0000"&gt;City&lt;/span&gt;&amp;quot;:&amp;quot;&lt;span style="color: #8b0000"&gt;New Orleans&lt;/span&gt;&amp;quot;,&amp;quot;&lt;span style="color: #8b0000"&gt;ContactName&lt;/span&gt;&amp;quot;:
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&amp;quot;&lt;span style="color: #8b0000"&gt;Shelley Burke&lt;/span&gt;&amp;quot;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&amp;quot;&lt;span style="color: #8b0000"&gt;ContactTitle&lt;/span&gt;&amp;quot;:&amp;quot;&lt;span style="color: #8b0000"&gt;Order &lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;As you can see – some nice looking JSon.&amp;#160;&amp;#160; Now, to write a very simple Ajax client.&lt;/p&gt;

&lt;p&gt;Below is an example query method in the Ajax client&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;         &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; query() {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; xmlhttp = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XMLHttpRequest();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            xmlhttp.open(&amp;quot;&lt;span style="color: #8b0000"&gt;GET&lt;/span&gt;&amp;quot;, &amp;quot;&lt;span style="color: #8b0000"&gt;BusinessApplication1-web-DishViewDomainService.svc/Json/GetRestaurants&lt;/span&gt;&amp;quot;, &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            xmlhttp.send();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; rawResults = JSON.parse(xmlhttp.responseText);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; results = rawResults.GetRestaurantsResult.RootResults;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; entity
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; i = 0; i &amp;lt; results.length; i++) 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                entity = results[i];
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                document.getElementById('results').innerHTML += ' &amp;lt;br&amp;gt; ' + entity.Name;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;           
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;This is wired up to to a very simple button&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &amp;lt;button type=&amp;quot;&lt;span style="color: #8b0000"&gt;button&lt;/span&gt;&amp;quot; onclick=&amp;quot;&lt;span style="color: #8b0000"&gt;query()&lt;/span&gt;&amp;quot;&amp;gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            Query&amp;lt;/button&amp;gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;
&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessA_EA89/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessA_EA89/image_thumb_1.png" width="299" height="299" /&gt;&lt;/a&gt; 

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Update is just a bit more tricky…&amp;#160; but still basic:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; update() {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; operation = {};
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            operation.Entity = { &amp;quot;&lt;span style="color: #8b0000"&gt;__type&lt;/span&gt;&amp;quot;: &amp;quot;&lt;span style="color: #8b0000"&gt;Restaurant:#BusinessApplication1.Web&lt;/span&gt;&amp;quot;, &amp;quot;&lt;span style="color: #8b0000"&gt;ID&lt;/span&gt;&amp;quot;: 1, &amp;quot;&lt;span style="color: #8b0000"&gt;Name&lt;/span&gt;&amp;quot;: &amp;quot;&lt;span style="color: #8b0000"&gt;Alinea - Updated from Ajax&lt;/span&gt;&amp;quot;};
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            operation.OriginalEntity = { &amp;quot;&lt;span style="color: #8b0000"&gt;__type&lt;/span&gt;&amp;quot;: &amp;quot;&lt;span style="color: #8b0000"&gt;Restaurant:#BusinessApplication1.Web&lt;/span&gt;&amp;quot;, &amp;quot;&lt;span style="color: #8b0000"&gt;ID&lt;/span&gt;&amp;quot;: 1, &amp;quot;&lt;span style="color: #8b0000"&gt;Name&lt;/span&gt;&amp;quot;: &amp;quot;&lt;span style="color: #8b0000"&gt;Alinea&lt;/span&gt;&amp;quot; };
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            operation.Operation = 3; &lt;span style="color: #008000"&gt;//update&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; csData = JSON.stringify({ &amp;quot;&lt;span style="color: #8b0000"&gt;changeSet&lt;/span&gt;&amp;quot;: [operation] });
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; xmlhttp = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XMLHttpRequest();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            xmlhttp.open('POST', 'BusinessApplication1-web-DishViewDomainService.svc/Json/SubmitChanges', &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            xmlhttp.setRequestHeader(&amp;quot;&lt;span style="color: #8b0000"&gt;Content-Type&lt;/span&gt;&amp;quot;, &amp;quot;&lt;span style="color: #8b0000"&gt;application/json&lt;/span&gt;&amp;quot;);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            xmlhttp.send(csData);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; results = xmlhttp.responseText;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            document.getElementById('results').innerHTML = results;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        }&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;In this demo, we showed how to enable the Ajax\JSON client for RIA Services.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9979102" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/Mix10/">Mix10</category></item><item><title>Silverlight 4 + RIA Services - Ready for Business: Exposing WCF (SOAP\WSDL) Services</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/29/silverlight-4-ria-services-ready-for-business-exposing-wcf-wsdl-services.aspx</link><pubDate>Mon, 29 Mar 2010 16:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9975980</guid><dc:creator>BradA</dc:creator><slash:comments>26</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9975980</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/29/silverlight-4-ria-services-ready-for-business-exposing-wcf-wsdl-services.aspx#comments</comments><description>&lt;P&gt;Continuing &lt;A href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx" mce_href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx"&gt;in our series&lt;/A&gt;, I wanted to touch on how a RIA Services can be exposed as a Soap\WSDL service.&amp;nbsp;&amp;nbsp; This is very useful if you want to enable the exact same business logic\data access logic is available to clients other than Silverlight.&amp;nbsp;&amp;nbsp;&amp;nbsp; For example to a WinForms application or WPF or even a console application.&amp;nbsp; SOAP is a particularly good model for interop with the Java\JEE world as well.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First you need to add a reference to Microsoft.ServiceModel.DomainSerivves.Hosting.EndPoints assembly from the RIA Services toolkit.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_thumb.png" width=244 height=198 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_thumb.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you need to edit the endpoints section of the domainserivces config in web.config&amp;nbsp; file.&amp;nbsp; Below I am showing the SOAP and OData endpoints enabled.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&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;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;system.serviceModel&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/PRE&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;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;domainServices&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/PRE&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;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;endpoints&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/PRE&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;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;add&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"OData"&lt;/SPAN&gt; 
&lt;/PRE&gt;&lt;/PRE&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;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"System.ServiceModel.DomainServices.Hosting.ODataEndpointFactory, System.ServiceModel.DomainServices.Hosting.OData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/PRE&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;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;add&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"Soap"&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/PRE&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;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"Microsoft.ServiceModel.DomainServices.Hosting.SoapXmlEndpointFactory, Microsoft.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/PRE&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;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;endpoints&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/PRE&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;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;domainServices&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, all you have to do is navigate in the browser to this URL:&lt;/P&gt;
&lt;P&gt;&lt;A title=http://localhost:21516/BusinessApplication1-web-DishViewDomainService.svc href="http://localhost:21516/BusinessApplication1-web-DishViewDomainService.svc" mce_href="http://localhost:21516/BusinessApplication1-web-DishViewDomainService.svc"&gt;http://localhost:21516/BusinessApplication1-web-DishViewDomainService.svc&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Note the pattern is [namespace]-[typename].svc&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_thumb_2.png" width=244 height=193 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;And we get the very familiar WCF service debug page.&lt;/P&gt;
&lt;P&gt;And if you really want to drill in, here is the full WSDL describing the service.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_8.png" mce_href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_thumb_3.png" width=244 height=193 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are done on the server, now let’s look at how you consume that on the client.&amp;nbsp;&amp;nbsp;&amp;nbsp; For the sake of simplicity, I have created a new Console application.&amp;nbsp; Right click on the project and select Add Services Reference.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_10.png" mce_href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_10.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_thumb_4.png" width=475 height=287 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_thumb_4.png"&gt;&lt;/A&gt; &lt;/P&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;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_thumb_1.png" width=418 height=390 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_thumb_1.png"&gt;&lt;/A&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;  1: var context = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; DishViewDomainServiceSoapClient();
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  2: var results = context.GetRestaurants();
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  3: &lt;SPAN style="COLOR: #0000ff"&gt;foreach&lt;/SPAN&gt; (var r &lt;SPAN style="COLOR: #0000ff"&gt;in&lt;/SPAN&gt; results.RootResults)
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  4: {
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  5:    Console.WriteLine(r.Name);
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  6: }
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  7: &lt;/PRE&gt;&lt;/PRE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code for query is very simple.&amp;nbsp; Line 1 creates the client proxy, line 2 does a synchronous call to the server. Then we simply loop through the results.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_12.png" mce_href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_thumb_5.png" width=457 height=298 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_thumb_5.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Updating the data is a little bit more interesting…&amp;nbsp;&amp;nbsp;&amp;nbsp; I need to create a ChanageSet that I populate with any updates. in this case I am updating just one value.&amp;nbsp; I also need to send the original value back to the server.&amp;nbsp; &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;  1: var changeSet = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; ChangeSetEntry();
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  2: var org = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; Restaurant();
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  3: org.ID = entity.ID;
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  4: org.Name = entity.Name;
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  5: entity.Name = "&lt;SPAN style="COLOR: #8b0000"&gt;Updated:&lt;/SPAN&gt;" + entity.Name;
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  6: changeSet.Entity = entity;
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  7: changeSet.OriginalEntity = org;
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  8: changeSet.Operation = DomainOperation.Update;
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  9: var updateResults = context.SubmitChanges(&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; ChangeSetEntry[] { changeSet });
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt; 10: &lt;/PRE&gt;&lt;/PRE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you can see the result of running this a couple of times:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_14.png" mce_href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_thumb_6.png" width=172 height=244 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_117B5/image_thumb_6.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more information, see Deepesh’s post on &lt;A href="http://blogs.msdn.com/deepm/archive/2010/03/17/configuring-your-domainservice-for-a-windows-phone-application.aspx" mce_href="http://blogs.msdn.com/deepm/archive/2010/03/17/configuring-your-domainservice-for-a-windows-phone-application.aspx"&gt;Configuring your DomainService for a Windows Phone 7 application&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For V1.0, this post describes the RIA Services story for WPF applications.&amp;nbsp; While it works, it is clearly not the complete, end-to-end solution RIA Services offers for Silverlight.&amp;nbsp;&amp;nbsp; For example, you may want the full experience:&amp;nbsp; the DataContext, entities with validation, LINQ queries, change tracking, etc.&amp;nbsp; This level of support for WPF is on the roadmap, but will not make V1.&amp;nbsp; But if you like the RIA Services approach, you might consider &lt;A href="http://www.ideablade.com/" mce_href="http://www.ideablade.com/"&gt;DevForce from IdeaBlade&lt;/A&gt; or &lt;A href="http://www.lhotka.net/cslanet/" mce_href="http://www.lhotka.net/cslanet/"&gt;CSLA.NET&lt;/A&gt; which works for both WPF and Silverlight.&amp;nbsp;&amp;nbsp; The great folks at IdeaBlade have offered me 10 free licenses to give out.&amp;nbsp; If you are interested in one, please let me know.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9975980" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/Mix10/">Mix10</category></item><item><title>Silverlight 4 + RIA Services - Ready for Business: Authentication and Personalization</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/26/silverlight-4-ria-services-ready-for-business-authentication-and-personalization.aspx</link><pubDate>Fri, 26 Mar 2010 14:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9974990</guid><dc:creator>BradA</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9974990</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/26/silverlight-4-ria-services-ready-for-business-authentication-and-personalization.aspx#comments</comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;To &lt;a title="continue our series" href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx"&gt;continue our series&lt;/a&gt;,&amp;#160; In real business applications our data is often very valuable and as such we need to know who is accessing what data and control certain data access to only users with privilege.&amp;#160; Luckily this is very easy to do with RIA Services.&amp;#160; For example, say we want to let only authenticated users access our data in this example.&amp;#160;&amp;#160; That is as easy to accomplish as adding an attribute, see line 2 below.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  1:     [EnableClientAccess]
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  2:     [RequiresAuthentication]
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  3:     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; DishViewDomainService : LinqToEntitiesDomainService&amp;lt;DishViewEntities&amp;gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  4:     {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  5: &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;When we run the application, we now get an error.&amp;#160; Clearly you can do a bit better from a user experience angle… but the message is clear enough.&amp;#160; &lt;/p&gt;

&lt;p&gt;&amp;#160; &lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[199].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_thumb[93]" border="0" alt="image_thumb[93]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessA_A121/image_thumb93.png" width="506" height="429" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Notice there is a login option, so we can log in… &lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[229].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_thumb[107]" border="0" alt="image_thumb[107]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessA_A121/image_thumb%5B107%5D_a6deb126-f34d-4781-acc9-a9407463b59a.png" width="244" height="198" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;and even create a new user.&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[230].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_thumb[108]" border="0" alt="image_thumb[108]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessA_A121/image_thumb%5B108%5D_654b429a-9929-48ca-ab63-c3ec2f795770.png" width="244" height="214" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;and with a refresh we now get our data&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[209].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_thumb[97]" border="0" alt="image_thumb[97]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessA_A121/image_thumb97.png" width="279" height="112" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;And the application knows who i am on the client and gives me a way to log out.&lt;/p&gt;

&lt;p&gt;Now you can also easily interact with the current user on the server.&amp;#160; So for example, only return records that they have edited, or, in this case, log every access:&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  1:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IQueryable&amp;lt;Restaurant&amp;gt; GetRestaurants()
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  2:         {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  3:             File.AppendAllLines(@&amp;quot;&lt;span style="color: #8b0000"&gt;C:\Users\brada\Desktop\log.txt&lt;/span&gt;&amp;quot;, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  4:                 String.Format(&amp;quot;&lt;span style="color: #8b0000"&gt;{0}:{1}&lt;/span&gt;&amp;quot;, DateTime.Now,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  5:                 &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ServiceContext.User.Identity.Name)});
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  6:             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ObjectContext.Restaurants
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  7:                 .Where (r=&amp;gt;r.Region != &amp;quot;&lt;span style="color: #8b0000"&gt;NC&lt;/span&gt;&amp;quot;)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  8:                 .OrderBy(r=&amp;gt;r.ID);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  9:         }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 10: &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Line 5 is the key one.. we are accessing the current users on the server.&amp;#160;&amp;#160; This gives us a nice simple log.&lt;/p&gt;

&lt;p&gt;&lt;font face="Fixedsys"&gt;3/7/2010 9:42:57 PM:darb 
    &lt;br /&gt;3/7/2010 9:43:05 PM:darb&lt;/font&gt; &lt;/p&gt;

&lt;p&gt;Now we can also personalize this a bit.&amp;#160; Say we want our users to be able to give us a favorite color and we keep track of that on the server and the client, so it works seamlessly from any machine.&amp;#160; &lt;/p&gt;

&lt;p&gt;First we need to add BackgroundColor to our backing store.&amp;#160; I this case I am using ASP.NET profile storage, so I add the right stuff to web.config&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[219].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_thumb[103]" border="0" alt="image_thumb[103]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessA_A121/image_thumb%5B103%5D_8d717f35-bb83-4042-b02f-1d4df9b40328.png" width="244" height="66" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Then I need to access this from the Silverlight client, so I add a property to the User instance in the Models\User.cs &lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; partial &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; User : UserBase
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,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; FriendlyName { &lt;span style="color: #0000ff"&gt;get&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,&amp;#39;Courier New&amp;#39;,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; BackgroundColor { &lt;span style="color: #0000ff"&gt;get&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,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Finally, we need to access&amp;#160; it on the client.&amp;#160;&amp;#160; In main.xaml add lines 2 and 3.. &lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  1:   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Grid&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;LayoutRoot&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Style&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;{StaticResource LayoutRootGridStyle}&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  2:         &lt;span style="color: #ff0000"&gt;Background&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;{Binding Path=User.BackgroundColor}&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  3:         &lt;span style="color: #ff0000"&gt;DataContext&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;{StaticResource WebContext}&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  4: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  5: &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Run it and we get our great default background color!&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[222].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_thumb[104]" border="0" alt="image_thumb[104]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessA_A121/image_thumb%5B104%5D_6d3da1de-00e1-4cd8-90c9-a0ff423f1e2e.png" width="244" height="208" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Now, that is nice, but it would be even better to give the user a chance to actually edit their settings.&amp;#160; So in About.xaml, we use a very similar model as above.&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Grid&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;LayoutRoot&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #ff0000"&gt;DataContext&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;{StaticResource WebContext}&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;sdk&lt;/span&gt;:&lt;span style="color: #800000"&gt;Label&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Content&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Background Color:&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;TextBox&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;{Binding Path=User.BackgroundColor, Mode=TwoWay}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Height&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;23&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Then wire up a save button&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,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; button1_Click(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, System.Windows.RoutedEventArgs e)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            WebContext.Current.Authentication.SaveUser(&lt;span style="color: #0000ff"&gt;false&lt;/span&gt;);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        }&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;And it works! &lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[225].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_thumb[105]" border="0" alt="image_thumb[105]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessA_A121/image_thumb%5B105%5D_c3d57467-d7b6-46b7-b793-1d9dee7861fc.png" width="244" height="154" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;And what’s better is if you run it from another browser, on another machine, once you log in you get the exact same preferences!&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[228].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_thumb[106]" border="0" alt="image_thumb[106]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessA_A121/image_thumb%5B106%5D_ff65f469-5bff-4e18-952b-bf7a9cae7e1b.png" width="244" height="161" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9974990" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/Mix10/">Mix10</category></item><item><title>Great Presentation to the Israel Dot Net Developers User Group (IDNDUG)</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/24/great-presentation-to-the-israel-dot-net-developers-user-group-idndug.aspx</link><pubDate>Thu, 25 Mar 2010 05:01:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9984813</guid><dc:creator>BradA</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9984813</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/24/great-presentation-to-the-israel-dot-net-developers-user-group-idndug.aspx#comments</comments><description>&lt;p&gt;I continue to be impressed with the quality of .NET Developers in Israel.. we had a full house last night for a 2+ hour presentation on building business applications with Silverlight and RIA Services.&amp;#160;&amp;#160; The audience was very engaged and had lots of good, relevant questions which created a really good conversation.&amp;#160;&amp;#160;&amp;#160; Check out the &lt;a href="http://brad_abrams.members.winisp.net/Projects/IsraelMarch2010/RIAServices.IsraelUserGroup.pptx"&gt;slides&lt;/a&gt; and &lt;a href="http://brad_abrams.members.winisp.net/Projects/IsraelMarch2010/MyApp.zip"&gt;demo&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I started off by demoing the Right-to-Left text support for &lt;a href="http://blogs.msdn.com/brada/archive/2010/03/22/silverlight-4-ria-services-ready-for-business-localizing-business-application.aspx"&gt;Hebrew that is baked in as part of Silverlight 4&lt;/a&gt;.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_6.png"&gt;&lt;img title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_thumb_2.png" width="416" height="254" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Then I started from scratch, with File\New Project and built out a simple data-oriented application.. basically &lt;a href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx"&gt;I walked though most of this series&lt;/a&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;You can find the &lt;a href="http://brad_abrams.members.winisp.net/Projects/IsraelMarch2010/MyApp.zip"&gt;completed demo&lt;/a&gt;, including the files and code snippets you would need to repeat the demo yourself, which i would be high flattered if you did at your own user’s group or for your development team.&amp;#160; You an find the demo steps in &lt;a href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx"&gt;the series&lt;/a&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/GreatPresentationtotheIsraelDotNetDevelo_135AB/image_2.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/GreatPresentationtotheIsraelDotNetDevelo_135AB/image_thumb.png" width="223" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;A couple of interesting links:&lt;/p&gt;  &lt;p&gt; - We talked about the ViewModel (MvvM) support for RIA Services.&amp;#160; I high recommend checking out &lt;a href="http://www.nikhilk.net/RIA-Services-MIX10-Slides-Code.aspx"&gt;MIX10 Talk - Slides and Code&lt;/a&gt; and &lt;a href="http://www.nikhilk.net/View-ViewModel-Interaction.aspx"&gt;View/ViewModel Interaction - Bindings, Commands and Triggers&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;- We also talked about SEO – here is a good post on it: &lt;a href="http://blogs.msdn.com/brada/archive/2010/03/17/silverlight-4-ria-services-ready-for-business-search-engine-optimization-seo.aspx"&gt;Silverlight 4 + RIA Services - Ready for Business: Search Engine Optimization (SEO)&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;- More details on the Silverlight out of browser work check out Tim Heuer’s video &lt;a href="http://www.silverlight.net/learn/videos/silverlight-videos/out-of-browser-experiences/"&gt;Out-of-browser Experiences&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; - During the break I showed a &lt;a href="http://www.myworldmaps.net/stumbler?maps=809779c2-ff91-4b79-83b3-533b92cee607"&gt;world map showing hits to my blog&lt;/a&gt; in real time from all over the world.&amp;#160; This is &lt;a href="http://www.myworldmaps.net/"&gt;Stumpler&lt;/a&gt;.. it is a VirtualEarth, Silverlight, Azure based service from &lt;a href="http://www.structuretoobig.com/home/"&gt;Brian Hitney&lt;/a&gt;.&amp;#160; You can add your own blog for free or just &lt;a href="http://www.myworldmaps.net/stumbler?maps=809779c2-ff91-4b79-83b3-533b92cee607"&gt;watch the hits to mine&lt;/a&gt;.&amp;#160; I expect to see Israel lighting up more often now ;-)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Thanks to &lt;a href="http://weblogs.asp.net/JackieG/"&gt;Jackie Goldstein&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/bursteg/"&gt;Guy Burstein&lt;/a&gt; for organizing the event and for Jackie and Kim for the unique tour of a &lt;a href="http://en.wikipedia.org/wiki/Kibbutz"&gt;Kibbutz&lt;/a&gt; – it was great fun!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9984813" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category></item><item><title>Program Manager (PM) Tip Index</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/23/program-manager-pm-tip-index.aspx</link><pubDate>Wed, 24 Mar 2010 05:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9983770</guid><dc:creator>BradA</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9983770</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/23/program-manager-pm-tip-index.aspx#comments</comments><description>&lt;P&gt;I thought it would be worthwhile to produce an index for the (very) occasional series I have on giving tips to PMs at Microsoft.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2009/06/24/pm-tip-10-interview-tips-for-landing-a-great-program-management-job.aspx" mce_href="http://blogs.msdn.com/brada/archive/2009/06/24/pm-tip-10-interview-tips-for-landing-a-great-program-management-job.aspx"&gt;PM Tip #10: Interview Tips for Landing a Great Program Management Job&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A id=ctl00___ctl00___ctl01___Results___postlist___EntryItems_ctl14_PostTitle href="http://blogs.msdn.com/brada/archive/2006/04/10/InformationIsTheCurrency.aspx"&gt;&lt;FONT color=#176db5&gt;PM tip# 11: Information is the Currency of Program Management &lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.msdn.com/brada/archive/2007/10/24/pm-tip-14-great-teams-have-members-that-defy-roles.aspx" mce_href="https://blogs.msdn.com/brada/archive/2007/10/24/pm-tip-14-great-teams-have-members-that-defy-roles.aspx"&gt;PM Tip #14: Great teams have members that defy roles&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.msdn.com/brada/archive/2007/05/06/pm-tip-12-don-t-waist-keystrokes.aspx" mce_href="https://blogs.msdn.com/brada/archive/2007/05/06/pm-tip-12-don-t-waist-keystrokes.aspx"&gt;PM Tip #12: Don't&amp;nbsp;waste keystrokes&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2006/02/22/536644.aspx" mce_href="http://blogs.msdn.com/brada/archive/2006/02/22/536644.aspx"&gt;PM Tip #21: Sanity Will Prevail&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2006/02/21/535235.aspx" mce_href="http://blogs.msdn.com/brada/archive/2006/02/21/535235.aspx"&gt;PM Tip # 32: Nothing kills excitement like ambiguity&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.msdn.com/brada/archive/2006/02/03/522857.aspx" mce_href="https://blogs.msdn.com/brada/archive/2006/02/03/522857.aspx"&gt;PM Tip #57: Write the agenda on the board&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2006/03/30/564573.aspx" mce_href="http://blogs.msdn.com/brada/archive/2006/03/30/564573.aspx"&gt;PM Tip #72 Instant feedback...&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2006/01/28/BeMoreVisibleSham.aspx" mce_href="http://blogs.msdn.com/brada/archive/2006/01/28/BeMoreVisibleSham.aspx"&gt;PM Tip #73: The "Be More Visible" Sham&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A id=ctl00___ctl00___ctl01___Results___postlist___EntryItems_ctl06_PostTitle href="http://blogs.msdn.com/brada/archive/2005/12/17/RevealYourStupidity-.aspx"&gt;PM Tip &amp;nbsp;#78: Reveal your stupidity &lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2009/03/27/presentation-tip-they-remember-the-mistakes-more-than-the-polish.aspx" mce_href="http://blogs.msdn.com/brada/archive/2009/03/27/presentation-tip-they-remember-the-mistakes-more-than-the-polish.aspx"&gt;Presentation tip: They Remember the Mistakes more than the Polish&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2006/12/23/building-consensus.aspx" mce_href="http://blogs.msdn.com/brada/archive/2006/12/23/building-consensus.aspx"&gt;Building Consensus&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A id=ctl00___ctl00___ctl01___Results___postlist___EntryItems_ctl06_PostTitle href="http://blogs.msdn.com/brada/archive/2007/07/28/that-is-a-full-day-s-work.aspx"&gt;&lt;FONT color=#176db5&gt;That is a full day's work!&lt;/FONT&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A id=ctl00___ctl00___ctl01___Results___postlist___EntryItems_ctl12_PostTitle href="http://blogs.msdn.com/brada/archive/2006/10/07/The-What-and-the-How.aspx"&gt;&lt;FONT color=#176db5&gt;The What and the How&lt;/FONT&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A id=ctl00___ctl00___ctl01___Results___postlist___EntryItems_ctl13_PostTitle href="http://blogs.msdn.com/brada/archive/2006/09/09/748066.aspx"&gt;&lt;FONT color=#176db5&gt;Thoughts on writing reviews...&lt;/FONT&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2007/05/18/the-wisdom-of-crowds-rethinking-consensus.aspx" mce_href="http://blogs.msdn.com/brada/archive/2007/05/18/the-wisdom-of-crowds-rethinking-consensus.aspx"&gt;The Wisdom of Crowds: Rethinking consensus&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe one day I will do the other 89 tips ;-)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9983770" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Program+Manager/">Program Manager</category></item><item><title>Silverlight 4 + RIA Services - Ready for Business: Validating Data</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/23/silverlight-4-ria-services-ready-for-business-validating-data.aspx</link><pubDate>Tue, 23 Mar 2010 17:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9974989</guid><dc:creator>BradA</dc:creator><slash:comments>8</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9974989</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/23/silverlight-4-ria-services-ready-for-business-validating-data.aspx#comments</comments><description>&lt;h3&gt;&amp;#160;&lt;/h3&gt;  &lt;p&gt;To &lt;a href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx"&gt;continue our series&lt;/a&gt; let’s look at data validation our business applications. Updating data is great, but when you enable data update you often need to check the data to ensure it is valid.&amp;#160; RIA Services as clean, prescriptive pattern for handling this.&amp;#160;&amp;#160; First let’s look at what you get for free.&amp;#160; The value for any field entered has to be valid for the range of that data type.&amp;#160; For example, you never need to write code to ensure someone didn’t type is “forty-two” into a textbox bound to an int field. You also get nice looking and well behaved validation exposure in the UI.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[176].png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image_thumb[82]" border="0" alt="image_thumb[82]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessV_A0D3/image_thumb82.png" width="325" height="164" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Note: if you are not seeing this, ensure that “ValidatesOnExceptions=True” is in the binding expression for the each field&lt;/p&gt;  &lt;p&gt;Of course, that sort of validation only goes so far, in&amp;#160; real application you need some more extensive validation.&amp;#160; And for this validation you absolutely have to check the validation before your business logic is run because you don’t know what client might be sending you the update, in addition, you want to check the validation on the client to give the user a really nice user experience and reduce the number of error-case hits to your server which reduces server load.&amp;#160;&amp;#160; In traditional models, you need do error checking twice to cover both of these cases.&amp;#160; But that is obviously error prone and easy to get out of sync.&amp;#160; So RIA Services offers a common model for validation.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;The most common cases are covered by a set of custom attributes you apply to your model on the server.&amp;#160; These attributes are common across the .NET Framework supported by ASP.NET Dynamic Data, ASP.NET MVC and RIA Services.&amp;#160; You can find the full set in System.ComponentModel.DataAnnotations.&amp;#160;&amp;#160;&amp;#160; But to give you a flavor:&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;[Display(Order = 0)]
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;[Required(ErrorMessage = &amp;quot;&lt;span style="color: #8b0000"&gt;Please provide a name&lt;/span&gt;&amp;quot;)]
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,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; Name { &lt;span style="color: #0000ff"&gt;get&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,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;[Range(0, 999)]
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Nullable&amp;lt;&lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;&amp;gt; Price { &lt;span style="color: #0000ff"&gt;get&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,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;[RegularExpression(@&amp;quot;&lt;span style="color: #8b0000"&gt;^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$&lt;/span&gt;&amp;quot;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                    ErrorMessage = &amp;quot;&lt;span style="color: #8b0000"&gt;Please use standard Url format&lt;/span&gt;&amp;quot;)]
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,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; Uri { &lt;span style="color: #0000ff"&gt;get&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,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[180].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_thumb[84]" border="0" alt="image_thumb[84]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessV_A0D3/image_thumb%5B84%5D_998ae026-6a1d-4963-ad34-3dbfaac71dc2.png" width="244" height="207" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;As you an see from above the validations on the client are handled automatically, but they are also run again on the server BEFORE your Update method is called.&amp;#160; This allows you to keep the validation gunk out of your business logic for Update.&amp;#160;&amp;#160; The other great thing is that these validations will apply in exactly the same way no mater where that entity is used in the UI because they are build into the model.&amp;#160;&amp;#160;&amp;#160; You can of course localize the error messages by passing a resource ID rather than a hard code string.&amp;#160; You can also read these validation metadata out of an external config file or database rather than using attributes in the code.&amp;#160; &lt;/p&gt;

&lt;p&gt;But clearly that doesn’t cover all cases.&amp;#160; Many times you need to write some actual procedural code.&amp;#160; Let’s consider an example of validating the description to ensure it is really complete.&amp;#160; There is no custom attribute for that ;-).&amp;#160; So let’s write a bit of C# code.&amp;#160; First we need to indicate that the Description field has some custom validation.&amp;#160; &lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;[CustomValidation(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(PlateValidationRules),
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                  &amp;quot;&lt;span style="color: #8b0000"&gt;IsDescriptionValid&lt;/span&gt;&amp;quot;)]
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,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; Description { &lt;span style="color: #0000ff"&gt;get&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,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Then you can easily create this class and implement the IsDescriptionValid method. &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  1:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; ValidationResult IsDescriptionValid(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; description)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  2:         {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  3:             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (description != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; description.Split().Length &amp;lt; 5)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  4:             {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  5:                 var vr = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ValidationResult(&amp;quot;&lt;span style="color: #8b0000"&gt;Valid descriptions must have 5 or more words.&lt;/span&gt;&amp;quot;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  6:                     &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] { &amp;quot;&lt;span style="color: #8b0000"&gt;Description&lt;/span&gt;&amp;quot; });
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  7:                 &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; vr;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  8:             }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  9: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 10:             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; ValidationResult.Success;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 11:         }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 12: &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Notice in line 1, the signature of the method must return a ValidationResult – this is a class from DataAnnotations that contains information about any validation errors.&amp;#160; The method also has to take one parameter that is the same type of the field it is being applied to.&amp;#160; You could do it on the entity level to do cross field validation.&amp;#160;&amp;#160; &lt;/p&gt;

&lt;p&gt;Next on line 3, i am implementing some very lame algorithm for determining if the description is valid or not.&amp;#160; &lt;/p&gt;

&lt;p&gt;On line 5 and 6, I return an error and indicate which field this applies to.&amp;#160; &lt;/p&gt;

&lt;p&gt;Now, run the application.&amp;#160; You will see that we can edit the description and tab off with no error, but if we submit, then we get back an error in exactly the same way as we saw before.&amp;#160; Notice I could have sent several entities and each of them could have errors.&amp;#160; RIA Services keeps up with each of them (we even give you a list) and as the user edits each one we show some UI like this.&amp;#160; &lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[186].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_thumb[86]" border="0" alt="image_thumb[86]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessV_A0D3/image_thumb%5B86%5D_9192e3aa-b3f1-4a23-b46d-7fe8bf4910df.png" width="244" height="176" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Note, if you see this sort of dialog instead:&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[183].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_thumb[85]" border="0" alt="image_thumb[85]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessV_A0D3/image_thumb%5B85%5D_3aba5d60-91e5-41af-baaa-b45c1c3f7aee.png" width="214" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;It likely means you need to write a handler for SubmitChanges on your DomainDataSource.&amp;#160; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;riaControls&lt;/span&gt;:&lt;span style="color: #800000"&gt;DomainDataSource&lt;/span&gt;  &lt;span style="color: #ff0000"&gt;SubmittedChanges&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;plateDomainDataSource_SubmittedChanges&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,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; plateDomainDataSource_SubmittedChanges(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, SubmittedChangesEventArgs e)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (e.HasError &amp;amp;&amp;amp;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                e.EntitiesInError.All(t =&amp;gt; t.HasValidationErrors))
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                e.MarkErrorAsHandled();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                System.Windows.MessageBox.Show(e.Error.ToString(), &amp;quot;&lt;span style="color: #8b0000"&gt;Load Error&lt;/span&gt;&amp;quot;, System.Windows.MessageBoxButton.OK);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                e.MarkErrorAsHandled();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Now, this is very cool because we have the full power of .NET to write our validation rules.&amp;#160; But the down side is that I only get validation once the change is submitted.&amp;#160; What I’d really like to do in some cases,&amp;#160; is have some write some custom validation logic and have it execute on the server AND the client.&amp;#160;&amp;#160;&amp;#160; Luckily we have the power of .NET on the client and the server so we can use shared code validation.&amp;#160; To enable this simply change the name of the file that contains the validation rule to include “.shared.cs” post-fix.&amp;#160; This changes causes the RIA Services MSBuild logic to compile the file for the client and the server.&amp;#160; &lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[190].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_thumb[88]" border="0" alt="image_thumb[88]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessV_A0D3/image_thumb%5B88%5D_a986a49e-1691-40fb-9f8f-633626844519.png" width="233" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Now the exact same code will run on the client and the server.&amp;#160; So if there is a bad description, we no longer have to round-trip to the server to work that out.&amp;#160; &lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[194].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_thumb[90]" border="0" alt="image_thumb[90]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessV_A0D3/image_thumb%5B90%5D_8b73dac4-f178-4ea1-9593-d6b68b69840a.png" width="244" height="173" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Of course, in a real world case you are likely to have both server-only and shared validation rules and RIA Services fully supports that scenario as well.&amp;#160; Simply define any shared validation rules in .shared.cs files and any server-only validation rules in another file.&amp;#160; &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9974989" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/Mix10/">Mix10</category></item><item><title>A Great Time at Developer Academy 4 In Israel</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/22/a-great-time-at-developer-academy-4-in-israel.aspx</link><pubDate>Mon, 22 Mar 2010 12:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9982902</guid><dc:creator>BradA</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9982902</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/22/a-great-time-at-developer-academy-4-in-israel.aspx#comments</comments><description>&lt;P&gt;&lt;A href="http://www.facebook.com/photo.php?pid=3723576&amp;amp;id=316319852407" mce_href="http://www.facebook.com/photo.php?pid=3723576&amp;amp;id=316319852407"&gt;&lt;IMG style="MARGIN: 0px 25px 0px 0px; DISPLAY: inline" align=left src="http://photos-h.ak.fbcdn.net/hphotos-ak-ash1/hs269.ash1/19672_321800862407_316319852407_3738674_2863556_n.jpg" width=200 height=271 mce_src="http://photos-h.ak.fbcdn.net/hphotos-ak-ash1/hs269.ash1/19672_321800862407_316319852407_3738674_2863556_n.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="MARGIN: 0px 0px 0px 15px; DISPLAY: inline" align=right src="http://static.powerlineblog.com/img/israel_flag.jpg" mce_src="http://static.powerlineblog.com/img/israel_flag.jpg"&gt;I had a great time today at &lt;A href="http://www.microsoft.com/israel/msdn/DevAcademy4/Content/Dev_Sessions.aspx" mce_href="http://www.microsoft.com/israel/msdn/DevAcademy4/Content/Dev_Sessions.aspx"&gt;Developer Academy 4&lt;/A&gt;.&amp;nbsp; It was in a beautiful part of Tel Aviv.&amp;nbsp; The weather was great and the food fantastic.&amp;nbsp; They had well over 1,000 paid attendees, so the house was PACKED.&amp;nbsp;&amp;nbsp; &lt;A href="http://www.facebook.com/pages/Developer-Academy-4#!/pages/Developer-Academy-4/316319852407?ref=search&amp;amp;sid=650776263.3718441865..1" mce_href="http://www.facebook.com/pages/Developer-Academy-4#!/pages/Developer-Academy-4/316319852407?ref=search&amp;amp;sid=650776263.3718441865..1"&gt;Dev Academy’s page on Facebook&lt;/A&gt;.&amp;nbsp; Including some &lt;A href="http://www.facebook.com/pages/Developer-Academy-4/316319852407?v=photos&amp;amp;ref=search" mce_href="http://www.facebook.com/pages/Developer-Academy-4/316319852407?v=photos&amp;amp;ref=search"&gt;pictures of me.&lt;/A&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I was very impressed with the high tech community in Israel.&amp;nbsp; Clearly Israel is a hub of hightech. &lt;/P&gt;
&lt;P&gt;I did a demo in the keynote where I showed off a few of the cool new features in Silverlight 4.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_2.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_thumb.png" width=341 height=257 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Update:&lt;/P&gt;
&lt;P&gt;You can watch the &lt;A href="http://bit.ly/9QR6Ah" mce_href=" http://bit.ly/9QR6Ah"&gt;Israel Developer Academy keynote&lt;/A&gt;&amp;nbsp; and my &lt;A href="http://bit.ly/clKJ95" mce_href="http://bit.ly/clKJ95"&gt;breakout session on RIA Services&lt;/A&gt;:&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I demoed the Silverlight PhotoBooth app to show Webcam support and raw video\image editing capabilities.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_thumb_1.png" width=244 height=154 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Then I showed the HtmlPuzzle application to show off out of browser support and deep integration with HTML as well has flash video&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_10.png" mce_href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_10.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_thumb_4.png" width=244 height=154 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_thumb_4.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Then I demoed the Silverlight text editor, showing off rich text experiences, printing, right click, etc.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_8.png" mce_href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_thumb_3.png" width=244 height=154 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Finally, i ended with showing the Silverlight business application localized to Hebrew with RTL support and some basic RIA Services demo.&amp;nbsp; See my blog post for more information: &lt;A href="http://blogs.msdn.com/brada/archive/2010/03/22/silverlight-4-ria-services-ready-for-business-localizing-business-application.aspx" mce_href="http://blogs.msdn.com/brada/archive/2010/03/22/silverlight-4-ria-services-ready-for-business-localizing-business-application.aspx"&gt;Silverlight 4 + RIA Services - Ready for Business: Localizing Business Application&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image13.png" mce_href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image13.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image_thumb7 border=0 alt=image_thumb7 src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_thumb7_2a1bfb5f-fcf2-482d-979d-791eacdf8c00.png" width=244 height=151 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/AGreatTimeatDeveloperAcademy4InIsrael_4E7D/image_thumb7_2a1bfb5f-fcf2-482d-979d-791eacdf8c00.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I had a great time at Dev Academy 4 and I am looking forward to seeing more of Israel! &lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.facebook.com/photo.php?pid=3723576&amp;amp;id=316319852407" mce_href="http://www.facebook.com/photo.php?pid=3723576&amp;amp;id=316319852407"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9982902" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category></item><item><title>Silverlight 4 + RIA Services - Ready for Business: Localizing Business Application</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/22/silverlight-4-ria-services-ready-for-business-localizing-business-application.aspx</link><pubDate>Mon, 22 Mar 2010 12:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9981479</guid><dc:creator>BradA</dc:creator><slash:comments>22</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9981479</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/22/silverlight-4-ria-services-ready-for-business-localizing-business-application.aspx#comments</comments><description>&lt;p&gt;To &lt;a href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx"&gt;continue our series&lt;/a&gt;, let’s look at localizing our business applications.&amp;#160; In today’s global village, it is often no longer OK to support only one language.&amp;#160;&amp;#160; Many real world business applications need to support multiple languages.&amp;#160; To demonstrate the pattern, let’s look at localizing the Silverlight Business Application Template.&lt;/p&gt;  &lt;p&gt;Update (3/28): I added a bit more explanation about setting culture in Visual Studio..&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;You can download &lt;a href="http://brad_abrams.members.winisp.net/Projects/Mix10/LocalizedBusinessApplication.zip"&gt;the completed solution&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here it is in English side-by-side with a localized version (notice the Hebrew is rendered Right-To-Left correctly):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_thumb_1.png" width="678" height="324" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_thumb_2.png" width="679" height="415" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Let’s start by creating a new Silverlight Business Application.&amp;#160;&amp;#160; Notice there is a server and a client project in the solution.&amp;#160;&amp;#160; The strings that are needed in both the server and client project are located in the server project and those that are only ever needed in the Silverlight client are in the client project.&amp;#160; Let’s start with the server.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_thumb_3.png" width="244" height="188" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In the Resources folder we see two sets of resources.&amp;#160; One for the Error messages and another for registration details.&amp;#160; These are in a the ResX format which is an Xml file format that has been around for a long time.. there are many localization tools outside of VS that support this format.&amp;#160; Here I will show the localization in VS.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;One setup step before we get started.&amp;#160; You need to explicitly tell Visual Studio what languages are supported in by the Silverlight application.&amp;#160; Unfortunately, this is not supported by the VS Project Properties dialog, so you need to edit the Silverlight Applications csproj file directly.&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;Right click on the Silverlight project and unload&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_28.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_thumb.png" width="218" height="244" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Right click again and select “Edit MyApp.csproj&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_30.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_thumb_4.png" width="244" height="193" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Then find the SupportedCultures attribute and add the full list of cultures your application supports.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_32.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_thumb_7.png" width="244" height="142" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Then right click on the project and re-load project.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Ok, done with the setup, on to the actual localization. &lt;/p&gt;  &lt;p&gt;The first step is to create a copy of each of these files with the [Local].resx extension.&amp;#160; For example, I created one called “ErrorResources.he.resx”.&amp;#160; Here is a &lt;a href="http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo(VS.71).aspx"&gt;full list of cultures codes&lt;/a&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;Then open the file in VS and you see a nice editing experience.&amp;#160; Simply replace the English text with the translated version. &lt;/p&gt;  &lt;p&gt;Below is the translation experience in progress:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image17.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image17_thumb.png" width="791" height="385" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Repeat for the RegistrationDataResources.resx file.&amp;#160; &lt;/p&gt;  &lt;p&gt;Next we need to make these new *.he.resx accessible from the client.&amp;#160;&amp;#160; First let’s find the client resources directory.&amp;#160; Notice the English resources are already linked in here.&amp;#160; We need to add the Hebrew ones we just created.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_thumb_5.png" width="223" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Right click and add an Existing Item&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_thumb_6.png" width="559" height="247" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Then browser to the ErrorResources.he.resx file in the web project.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image28.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image28_thumb.png" width="480" height="343" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Then select add as Link &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_18.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_thumb_8.png" width="557" height="168" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Repeat for the other localized files from on the client.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_20.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_thumb_9.png" width="355" height="367" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In ApplicationStrings.resx and ApplicationStrings.he.resx I added one additional value to indicate flow direction&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_22.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_thumb_10.png" width="473" height="84" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I then made two very small tweaks to the template to use this value.&amp;#160; In each top level window, I need to set the flow direction.&lt;/p&gt;  &lt;p&gt;in Main.xaml:&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;UserControl&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #ff0000"&gt;x&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;Class&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;LocalizedBusinessApplication.MainPage&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;x&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #ff0000"&gt;FlowDirection&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;{Binding Path=ApplicationStrings.FlowDirection, Source={StaticResource ResourceWrapper}}&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;
and in View\LoginRegistrationWindow.xaml 

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;controls&lt;/span&gt;:&lt;span style="color: #800000"&gt;ChildWindow&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #ff0000"&gt;x&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;Class&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;LocalizedBusinessApplication.LoginUI.LoginRegistrationWindow&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #ff0000"&gt;x&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;childWindow&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;400&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #ff0000"&gt;Title&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;{Binding Path=ApplicationStrings.LoginWindowTitle, Source={StaticResource ResourceWrapper}}&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #ff0000"&gt;Style&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;{StaticResource LogRegWindowStyle}&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #ff0000"&gt;FlowDirection&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;{Binding Path=ApplicationStrings.FlowDirection, Source={StaticResource ResourceWrapper}}&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #ff0000"&gt;Closing&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;LoginWindow_Closing&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Now, we are ready to run the app.&amp;#160; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_24.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_thumb_11.png" width="488" height="129" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;It looks great, but it is all English.. how can we test the localization?&amp;#160; Simply change your language in the browser.&lt;/p&gt;

&lt;p&gt;In IE that is Tools\Internet Options&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_26.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image_thumb_12.png" width="438" height="635" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Make sure Hebrew is first. Then hit refresh on the page and…&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image52.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessL_DF28/image52_thumb.png" width="871" height="253" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;What I showed here was how to localize a Silverlight application using the Business Application Template.&amp;#160; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Enjoy! &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9981479" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/Mix10/">Mix10</category></item><item><title>Mix2010: Search Engine Optimization (SEO) for Microsoft Silverlight</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/17/mix2010-search-engine-optimization-seo-for-microsoft-silverlight.aspx</link><pubDate>Wed, 17 Mar 2010 20:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9980684</guid><dc:creator>BradA</dc:creator><slash:comments>19</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9980684</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/17/mix2010-search-engine-optimization-seo-for-microsoft-silverlight.aspx#comments</comments><description>&lt;p&gt;I had a great time today in my &lt;a href="http://live.visitmix.com/MIX10/Sessions/CL50" mce_href="http://live.visitmix.com/MIX10/Sessions/CL50"&gt;Mix2010 session on SEO for Silverlight&lt;/a&gt;.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;Update: You can watch the video here:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://live.visitmix.com/MIX10/Sessions/CL50"&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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Mix2010SearchEngineOptimizationSEOforMic_12EEC/image_3.png" width="244" height="140" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Or &lt;a href="http://live.visitmix.com/MIX10/Sessions/CL50"&gt;download the video&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;You can find all the &lt;a href="http://brad_abrams.members.winisp.net/Projects/Mix10/SearchEngineOptimizationForMicrosoftSilverlight.pptx" mce_href="http://brad_abrams.members.winisp.net/Projects/Mix10/SearchEngineOptimizationForMicrosoftSilverlight.pptx"&gt;slides (more than I was able to cover in the talk) here&lt;/a&gt;.&amp;#160; and the the full &lt;a href="http://blogs.msdn.com/brada/archive/2010/03/17/silverlight-4-ria-services-ready-for-business-search-engine-optimization-seo.aspx" mce_href="http://blogs.msdn.com/brada/archive/2010/03/17/silverlight-4-ria-services-ready-for-business-search-engine-optimization-seo.aspx"&gt;play-by-play of the demo&lt;/a&gt; (include a link to the completed solution).&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;I started off talking why SEO matters&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Mix2010SearchEngineOptimizationSEOforMic_B74F/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Mix2010SearchEngineOptimizationSEOforMic_B74F/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Mix2010SearchEngineOptimizationSEOforMic_B74F/image_thumb.png" width="244" height="184" mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Mix2010SearchEngineOptimizationSEOforMic_B74F/image_thumb.png" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Then I talked about three tips&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Mix2010SearchEngineOptimizationSEOforMic_B74F/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Mix2010SearchEngineOptimizationSEOforMic_B74F/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Mix2010SearchEngineOptimizationSEOforMic_B74F/image_thumb_1.png" width="244" height="184" mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Mix2010SearchEngineOptimizationSEOforMic_B74F/image_thumb_1.png" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can view the site live by using Bing for &lt;a href="http://www.bing.com/search?q=my+foodie+Explorer+Cooking+Class+with+Joe..&amp;amp;src=IE-SearchBox&amp;amp;FORM=IE8SRC" mce_href="http://www.bing.com/search?q=my+foodie+Explorer+Cooking+Class+with+Joe..&amp;amp;src=IE-SearchBox&amp;amp;FORM=IE8SRC"&gt;“my foodie Explorer Cooking Class with Joe..”&lt;/a&gt; or &lt;a href="http://www.google.com/#hl=en&amp;amp;source=hp&amp;amp;q=my+foodie+Explorer+Cooking+Class+with+Joe..&amp;amp;btnG=Google+Search&amp;amp;aq=f&amp;amp;aqi=&amp;amp;aql=&amp;amp;oq=my+foodie+Explorer+Cooking+Class+with+Joe..&amp;amp;fp=f55f94328208dcc1" mce_href="http://www.google.com/#hl=en&amp;amp;source=hp&amp;amp;q=my+foodie+Explorer+Cooking+Class+with+Joe..&amp;amp;btnG=Google+Search&amp;amp;aq=f&amp;amp;aqi=&amp;amp;aql=&amp;amp;oq=my+foodie+Explorer+Cooking+Class+with+Joe..&amp;amp;fp=f55f94328208dcc1"&gt;the other guys search engine equally well&lt;/a&gt;.&amp;#160; ;-)&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9980684" width="1" height="1"&gt;</description></item><item><title>Silverlight 4 + RIA Services - Ready for Business: Search Engine Optimization (SEO)</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/17/silverlight-4-ria-services-ready-for-business-search-engine-optimization-seo.aspx</link><pubDate>Wed, 17 Mar 2010 19:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9975103</guid><dc:creator>BradA</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9975103</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/17/silverlight-4-ria-services-ready-for-business-search-engine-optimization-seo.aspx#comments</comments><description>&lt;p&gt;To &lt;a href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx"&gt;continue our series&lt;/a&gt;, let’s look at SEO and Silverlight.&amp;#160; The vast majority of web traffic is driven by search. Search engines are the first stop for many users on the public internet and is increasingly so in corporate environments as well.&amp;#160; Search is also the key technology that drives most ad revenue.&amp;#160; So needless to say, SEO is important.&amp;#160; But how does SEO work in a Silverlight application where most of the interesting content is dynamically generated?&amp;#160;&amp;#160; I will present an application pattern for doing SEO in a Silverlight with the minimum of extra work.&amp;#160; &lt;/p&gt;  &lt;p&gt;There are three fun-and-easy steps to making your Silverlight application SEO friendly.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Step 1: Make important content deep linkable &lt;/li&gt;    &lt;li&gt;Step 2: Let the search engines know about all those deep links with a sitemap &lt;/li&gt;    &lt;li&gt;Step 3: Provide a “down level” version of important content &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Let’s drill into each of these areas by walk through an example.&amp;#160;&amp;#160; I am going to use my PDC2009 demo “foodie Explorer” as a base line.&amp;#160; You might consider reading my previous walk through (&lt;a href="http://blogs.msdn.com/brada/archive/2009/11/19/pdc09-talk-building-amazing-business-applications-with-silverlight-4-ria-services-and-visual-studio-2010.aspx"&gt;PDC09 Talk: Building Amazing Business Applications with Silverlight 4, RIA Services and Visual Studio 2010&lt;/a&gt;) to get some background before we begin.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/Projects/Mix10/MyApp.SEO.zip"&gt;Download the completed sample&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;/h3&gt;  &lt;h3&gt;Step 1: Make important content deep linkable&lt;/h3&gt;  &lt;p&gt;Any content on your site that you want to be individually searchable needs to be URL accessible.&amp;#160; If I want you to be able to use Bing (or Google, or whatever) for “Country Fried Steak” and land on my page listing pictures of Country Fried Steak I need to offer a URL that brings you to exactly this content.&amp;#160;&amp;#160; &lt;a href="http://foo.com/foodieExplorer.aspx"&gt;http://foo.com/foodieExplorer.aspx&lt;/a&gt; is not good enough, I need to offer a URL such as &lt;a href="http://foo.com/foodieExplorer.aspx?food"&gt;http://foo.com/foodieExplorer.aspx?food&lt;/a&gt;=”Country Fried steak”.&amp;#160;&amp;#160;&amp;#160; Note that there are other great benefits to this technique as well.&amp;#160; For example, users can tweet, email and IM these URLs to discuss particular content from your application.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Luckily with the Silverlight navigation feature it is very easy to do add support for deep linking.&amp;#160; Let’s take a look at how to do this in a Silverlight app.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_1.png" width="244" height="188" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;What we want to do is provide a URL that can identify a given a given restaurant or a restaurant and a particular plate. For SEO as well as better human readability reasons, we’d like the URL format such as &lt;a href="http://www.hanselman.com/abrams/restaurant/25/plate/4"&gt;http://www.hanselman.com/abrams/restaurant/25/plate/4&lt;/a&gt;,&amp;#160; to indicate that this is restaurant=25 and plate=4.&amp;#160;&amp;#160;&amp;#160; To enable this, let’s define the routes in the web project in global.asax.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  1:     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Global : HttpApplication
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  2:     {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  3:         &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Application_Start(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, EventArgs e)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  4:         {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  5:             RegisterRoutes(RouteTable.Routes);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  6:         }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  7: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  8:         &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RegisterRoutes(RouteCollection routes)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  9:         {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 10:             routes.MapPageRoute(
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 11:                 &amp;quot;&lt;span style="color: #8b0000"&gt;deepLinkRouteFull&lt;/span&gt;&amp;quot;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 12:                 &amp;quot;&lt;span style="color: #8b0000"&gt;restaurant/{restaurantId}/plate/{plateId}&lt;/span&gt;&amp;quot;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 13:                 &amp;quot;&lt;span style="color: #8b0000"&gt;~/default.aspx&lt;/span&gt;&amp;quot;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 14:                 &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 15:                 &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RouteValueDictionary { { &amp;quot;&lt;span style="color: #8b0000"&gt;restaurant&lt;/span&gt;&amp;quot;, &amp;quot;&lt;span style="color: #8b0000"&gt;-1&lt;/span&gt;&amp;quot; }, 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 16:                                            { &amp;quot;&lt;span style="color: #8b0000"&gt;plate&lt;/span&gt;&amp;quot;, &amp;quot;&lt;span style="color: #8b0000"&gt;-1&lt;/span&gt;&amp;quot; } });
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 17:                         
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 18:             routes.MapPageRoute(
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 19:                 &amp;quot;&lt;span style="color: #8b0000"&gt;deepLinkRoute&lt;/span&gt;&amp;quot;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 20:                 &amp;quot;&lt;span style="color: #8b0000"&gt;restaurant/{restaurantId}&lt;/span&gt;&amp;quot;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 21:                 &amp;quot;&lt;span style="color: #8b0000"&gt;~/default.aspx&lt;/span&gt;&amp;quot;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 22:                 &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 23:                 &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RouteValueDictionary { { &amp;quot;&lt;span style="color: #8b0000"&gt;restaurant&lt;/span&gt;&amp;quot;, &amp;quot;&lt;span style="color: #8b0000"&gt;-1&lt;/span&gt;&amp;quot; } });
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 24: &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;In line 12 and 20 we define the pattern of the deep links we support with the restaurantId and plateId place holders for the values in the URL.&amp;#160; We define them in order from most complex to least complex.&amp;#160; The defaults are given in 15 and 23 if the Ids are left off the URL.&amp;#160; &lt;/p&gt;

&lt;p&gt;Now, let’s look at how to parse this URL on the Silverlight client.&amp;#160; In Plates.xaml.cs:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  1:         &lt;span style="color: #008000"&gt;// Executes when the user navigates to this page.&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  2:         &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; OnNavigatedTo(NavigationEventArgs e)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  3:         {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  4:             &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; plateID = -1;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  5:             &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; restaurantId  =-1;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  6:             var s = HtmlPage.Document.DocumentUri.ToString().Split(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt;[] {'/','#'});
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  7:             &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = Find(s, &amp;quot;&lt;span style="color: #8b0000"&gt;plate&lt;/span&gt;&amp;quot;);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  8:             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (i != -1)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  9:             {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 10:                 plateID = Convert.ToInt32(s[i + 1]);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 11:                 plateDomainDataSource.FilterDescriptors.Add(
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 12:                     &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; FilterDescriptor(&amp;quot;&lt;span style="color: #8b0000"&gt;ID&lt;/span&gt;&amp;quot;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 13:                         FilterOperator.IsEqualTo, plateID));
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 14:             }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 15:             i = Find(s, &amp;quot;&lt;span style="color: #8b0000"&gt;restaurant&lt;/span&gt;&amp;quot;);          
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 16:             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (i != -1) restaurantId = Convert.ToInt32(s[i + 1]);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 17:             &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; restaurantId = Convert.ToInt32(NavigationContext.QueryString[&amp;quot;&lt;span style="color: #8b0000"&gt;restaurantId&lt;/span&gt;&amp;quot;]);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 18:             plateDomainDataSource.QueryParameters.Add(
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 19:                &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Parameter()
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 20:                {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 21:                   ParameterName = &amp;quot;&lt;span style="color: #8b0000"&gt;resId&lt;/span&gt;&amp;quot;,
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 22:                   Value = restaurantId 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 23:                }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 24:             );
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 25:         }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 26: &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Basically what the code above does is get the full URL and parse out the parts of the URL and parse out the restaurant and plate ids.&amp;#160; In lines 18-23, we are passing the restaurantId as a parameter to the query method and in lines 11-14 above, we are not using a query method, but rather than apply filter descriptor which adds a “where” clause to the LINQ query sent to the server.&amp;#160;&amp;#160; As a result,&amp;#160; we don’t need to change any server code.&amp;#160; &lt;/p&gt;

&lt;p&gt;One other little thing we need to do, is make sure the client ends up on Plates page.&amp;#160; That is handled by the silverlight navigation framework by using the “#/Plates” anchor tag.&amp;#160; Because anchor tags are a client only feature, the search engines can’t deal with them very effectively.&amp;#160; So we need to add this in on the client.&amp;#160; I found it was easy enough to do it just a bit of JavaScript.&amp;#160; I emit this from Default.aspx page on the server.&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  1: &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Page_Init(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, EventArgs e)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  2: {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  3:    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; resId = Page.RouteData.Values[&amp;quot;&lt;span style="color: #8b0000"&gt;restaurant&lt;/span&gt;&amp;quot;] &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  4:    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (resId != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) { Response.Write(&amp;quot;&lt;span style="color: #8b0000"&gt;&amp;lt;script type=text/javascript&amp;gt;window.location.hash='#/Plates';&amp;lt;/script&lt;/span&gt;&amp;quot;+&amp;quot;&lt;span style="color: #8b0000"&gt;&amp;gt;&lt;/span&gt;&amp;quot;); }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  5: }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  6:    &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;One little thing to watch out for is that with this routing feature enabled, now the default.aspx page is actived from a different URL, so the relative paths from the silverlight.js and MyApp.xap will not work.&amp;#160; For example you will see requests for &lt;a href="http://www.hanselman.com/abrams/restaurant/25/plate/4/Silverlight.js"&gt;http://www.hanselman.com/abrams/restaurant/25/plate/4/Silverlight.js&lt;/a&gt; rather than &lt;a href="http://www.hanselman.com/abrams/silverlight.js"&gt;http://www.hanselman.com/abrams/silverlight.js&lt;/a&gt;.&amp;#160; And this will result in an error such as:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_52.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb.png" width="244" height="169" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Line: 56 
  &lt;br /&gt;Error: Unhandled Error in Silverlight Application 

  &lt;br /&gt;Code: 2104&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;Category: InitializeError&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;Message: Could not download the Silverlight application. Check web server settings&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;

&lt;p&gt;To address this, &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;'&amp;lt;%= this.ResolveUrl(&amp;quot;~/Silverlight.js&amp;quot;) %&amp;gt;'&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;and &lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;param&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;source&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;value&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;&amp;lt;%= this.ResolveUrl(&amp;quot;&lt;/span&gt;~/&lt;span style="color: #ff0000"&gt;ClientBin&lt;/span&gt;/&lt;span style="color: #ff0000"&gt;MyApp&lt;/span&gt;.&lt;span style="color: #ff0000"&gt;xap&lt;/span&gt;&amp;quot;) %&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&amp;quot;/&amp;gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Now we give a URL that includes a PlateID such as:&lt;/p&gt;

&lt;p&gt;&lt;a title="http://localhost:30045/restaurant/48/plate/119#/Plates" href="http://localhost:30045/restaurant/48/plate/119#/Plates"&gt;http://localhost:30045/restaurant/48/plate/119#/Plates&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_54.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_25.png" width="633" height="122" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;As a result, we get our individual item…&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_68.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_26.png" width="408" height="322" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Step 2: Let the search engines know about all those deep links with a Sitemap&lt;/h3&gt;

&lt;p&gt;Now we have our application deep linkable, with every interesting bit of data having a unique URL.&amp;#160; But how is a search engine going to be able to find these URLs?&amp;#160; We certainly hope as people talk about (and therefore link to) our site on social networks the search engines will pick up some of them, but we might want to do a more complete job.&amp;#160; We might want to provide the search engine what ALL the deep links in the application.&amp;#160;&amp;#160; We can do that with a sitemap.&amp;#160; &lt;/p&gt;

&lt;p&gt;The Sitemap format is agreed to by all the major search engines.. you can find more information on it at &lt;a href="http://sitemap.org"&gt;http://sitemap.org&lt;/a&gt;.&amp;#160; &lt;/p&gt;

&lt;p&gt;To understand how this works, let’s look at the process a search engine would use to index an interesting data driven site: &lt;a href="http://amazon.com"&gt;http://amazon.com&lt;/a&gt;.&amp;#160;&amp;#160; When a search engine first hits such a site it reads the robots.txt file at the root of the site.&amp;#160; In this case: &lt;a title="http://www.amazon.com/robots.txt" href="http://www.amazon.com/robots.txt"&gt;http://www.amazon.com/robots.txt&lt;/a&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_6.png" width="222" height="341" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;In this example, you can see at the top of the file there is a list of directories that the search engines are asked to skip&amp;#160;&amp;#160; Then at the bottom of this page, there is a list of sitemaps for the search engine to use to crawl all the site’s content.&amp;#160; &lt;/p&gt;

&lt;p&gt;Note:&amp;#160; You don’t, strictly speaking have to use a sitemap.&amp;#160; You can use the sitemaster tools provided by the major search engines to register your sitemap directly.&amp;#160; &lt;/p&gt;

&lt;p&gt;If we navigate to one of those URLs, we see a sitemap file, as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_7.png" width="244" height="190" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;In this case, because Amazon.com is so huge, these links are actually to more sitemaps (this file is known as a Sitemap index file).&amp;#160; When we bottom out, we do get to links to actual products.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_18.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_8.png" width="396" height="293" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;As you can see the format looks like:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;urlset&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;http://www.google.com/schemas/sitemap/0.84&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;loc&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;http://www.amazon.com/GAITHER-COMMITTEE-EISENHOWER-COLD-WAR/dp/081425005X&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;loc&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;loc&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;http://www.amazon.com/CONTROLLING-VICE-REGULATING-PROSTITUTION-CRIMINAL/dp/0814250076&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;loc&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;One thing that is interesting here is that these links are constantly changing as items are added and removed from the Amazon catalog.&amp;#160; &lt;/p&gt;

&lt;p&gt;Let’s look at how we build a sitemap like this for our site.&amp;#160; &lt;/p&gt;

&lt;p&gt;In the web project, add a new Search Sitemap using the Add New Item dialog in VS and selected the Search Sitemap item. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_60.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_29.png" width="366" height="247" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Be sure to install the &lt;a href="http://silverlight.net/riaservices"&gt;RIA Services Toolkit&lt;/a&gt; to get this support.&lt;/p&gt;

&lt;p&gt;When we do this we get a robots.txt file that looks like:&lt;/p&gt;

&lt;p&gt;&lt;font size="2" face="Fixedsys"&gt;# This file provides hints and instructions to search engine crawlers. 
    &lt;br /&gt;# For more information, see &lt;/font&gt;&lt;a href="http://www.robotstxt.org/"&gt;&lt;font size="2" face="Fixedsys"&gt;http://www.robotstxt.org/&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Fixedsys"&gt;. &lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2" face="Fixedsys"&gt;# Allow all 
    &lt;br /&gt;User-agent: * &lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2" face="Fixedsys"&gt;# Prevent crawlers from indexing static resources (images, XAPs, etc) 
    &lt;br /&gt;Disallow: /ClientBin/ &lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2" face="Fixedsys"&gt;# Register your sitemap(s) here. 
    &lt;br /&gt;Sitemap: /Sitemap.aspx&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;and a sitemap.aspx file.&amp;#160; &lt;/p&gt;

&lt;p&gt;For more information check out: &lt;a href="http://www.bing.com/community/blogs/webmaster/archive/2009/08/15/uncovering-web-based-treasure-with-sitemaps-sem-101.aspx"&gt;Uncovering web-based treasure with Sitemaps&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To build this sitemap,we need to create another view of the same data from our PlateViewDomainService.&amp;#160; In this case we are consuming it from a ASP.NET webpage. To do this, we use the asp:DomainDataSource.&amp;#160;&amp;#160; You can configure this in the designer by:&lt;/p&gt;

&lt;p&gt;By drag-and-dropping a Repeater control to the form we get the follow design experience:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_20.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_9.png" width="244" height="157" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;then right click on it and configure the data source.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_22.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_10.png" width="436" height="117" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Select a new DataSource&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_62.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_30.png" width="369" height="294" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_64.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_31.png" width="244" height="192" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_66.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_32.png" width="244" height="192" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Finally, we end up with two sets of links in our sitemap.&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  1: &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DomainDataSource&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;RestaurauntSitemapDataSource&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  2:         &lt;span style="color: #ff0000"&gt;DomainServiceTypeName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;MyApp.Web.DishViewDomainService&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  3:         &lt;span style="color: #ff0000"&gt;QueryName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;GetRestaurants&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  4: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  5: &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;Repeater&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;repeater&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DataSourceID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;RestaurauntSitemapDataSource&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  6:     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;HeaderTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  7:         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;urlset&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;http://www.sitemaps.org/schemas/sitemap/0.9&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  8:     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;HeaderTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  9:     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;         
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 10:               &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 11:                  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;loc&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background-color: #ffff00; color: black"&gt;&amp;lt;%&lt;/span&gt;= Request.Url.AbsoluteUri.ToLower().Replace(&amp;quot;sitemap.aspx&amp;quot;,string.Empty) + &amp;quot;restaurant/&amp;quot;&lt;span style="background-color: #ffff00; color: black"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="background-color: #ffff00; color: black"&gt;&amp;lt;%&lt;/span&gt;# HttpUtility.UrlEncode(Eval(&amp;quot;ID&amp;quot;).ToString()) &lt;span style="background-color: #ffff00; color: black"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;loc&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 12:               &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 13:  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 14: &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;Repeater&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 15: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 16: &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DomainDataSource&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;PlatesSitemapDataSource&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 17:     &lt;span style="color: #ff0000"&gt;DomainServiceTypeName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;MyApp.Web.DishViewDomainService&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 18:     &lt;span style="color: #ff0000"&gt;QueryName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;GetPlates&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 19: &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DomainDataSource&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 20: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 21: &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;Repeater&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;  &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;repeater2&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DataSourceID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;PlatesSitemapDataSource&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 22:     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 23:             &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;  
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 24:                &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;loc&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background-color: #ffff00; color: black"&gt;&amp;lt;%&lt;/span&gt;= Request.Url.AbsoluteUri.ToLower().Replace(&amp;quot;sitemap.aspx&amp;quot;,string.Empty) + &amp;quot;restaurant/&amp;quot;&lt;span style="background-color: #ffff00; color: black"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="background-color: #ffff00; color: black"&gt;&amp;lt;%&lt;/span&gt;# HttpUtility.UrlEncode(Eval(&amp;quot;RestaurantID&amp;quot;).ToString()) + &amp;quot;/plate/&amp;quot; + HttpUtility.UrlEncode(Eval(&amp;quot;ID&amp;quot;).ToString()) &lt;span style="background-color: #ffff00; color: black"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;loc&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;    
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 25:             &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;        
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 26:     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 27:     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;FooterTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 28:         &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;urlset&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 29:     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;FooterTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 30: &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;Repeater&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 31: &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;As you can see in line 3 and 20, we are calling the use the GetRestaurant and GetPlates method defined in our DomainService directly.&amp;#160;&amp;#160; &lt;/p&gt;

&lt;p&gt;Now, for any reasonable set of data this is going to be a VERY expensive page to execute.&amp;#160; It scans every row in the database.&amp;#160; While it is nice to keep the data fresh, we’d like balance that server load.&amp;#160; One easy way to do that is to use output caching for 1 hour. For more information see: &lt;strong&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa478965.aspx"&gt;ASP.NET Caching: Techniques and Best Practices&lt;/a&gt;&lt;/strong&gt;&amp;#160;&amp;#160; &lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="background-color: #ffff00; color: black"&gt;&amp;lt;%@ OutputCache Duration=&amp;quot;3600&amp;quot; VaryByParam=&amp;quot;None&amp;quot; %&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Another approach for really large datasets would be to factor the data into multiple sitemaps as the amazon.com example we saw above does.&amp;#160; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_72.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_34.png" width="311" height="372" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;If we grab one of those URLs and navigate to them, bingo!&amp;#160; We get the right page.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_26.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_12.png" width="444" height="261" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Step 3: Provide a “down-level” version of important content&lt;/h3&gt;

&lt;p&gt;That is fantastic, we have deep links, we have a way for the search engines to discover all of those links, but what is the search engine going to find when it gets to this page?&amp;#160;&amp;#160;&amp;#160; Well, search engines for the most part only parse HTML, so if we do a Page\View Source,&amp;#160; we will see what the search engine sees:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_28.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_13.png" width="579" height="335" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Of if we browse with Silverlight disabled (Tools\Manage Addons), we see this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_30.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_14.png" width="481" height="276" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;We see a big old white page of nothing!&amp;#160; &lt;/p&gt;

&lt;p&gt;Certainly none of the dynamic content is presented. The code actually has to be run for the dynamic content to be loaded.&amp;#160; I am pretty sure search engines are not going to be running this silverlight (or flash or ajax) code in their datacenters anytime soon.&amp;#160; So what we need, is some alternate content.&amp;#160; &lt;/p&gt;

&lt;p&gt;Luckily this is pretty easy to do.&amp;#160; First lets get any alternate content to render.&amp;#160; It is important to note that this&amp;#160; content is not just for the search engines. Content written solely for search engines is sometimes called search engine spoofing or Web Spam when it is done to mislead users of search engines about the true nature of the site.&amp;#160; (&lt;a href="http://www.bing.com/community/blogs/webmaster/archive/2010/02/11/the-pernicious-perfidy-of-page-level-web-spam-sem-101.aspx"&gt;the pernicious perfidy of page-level web spam&lt;/a&gt;) .&amp;#160; Instead, this content is an alternate rendering of the page for anyone that doesn’t have Silverlight installed.&amp;#160; It might not have all the features, but it is good down level experience.&amp;#160;&amp;#160; It just so happens that the search engine’s crawlers do not have Silverlight installed, so they get something meaningful and accurate to index.&amp;#160; &lt;/p&gt;

&lt;p&gt;Add this HTML code to your default.aspx page.&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;AlternativeContent&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;style&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;display: none;&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;h2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Hi, this is my alternative content&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;h2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Notice it is display: none, meaning we don’t expect the browser to render it… unless Silverlight is not available.&amp;#160; To accomplish that, add this bit of code to the page:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&amp;lt;script type=&amp;quot;&lt;span style="color: #8b0000"&gt;text/javascript&lt;/span&gt;&amp;quot;&amp;gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!isSilverlightInstalled()) {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; obj = &lt;span style="color: #0000ff"&gt;document&lt;/span&gt;.getElementById('AlternativeContent');
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            obj.style.display = &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&amp;lt;/script&amp;gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Note, the really cool isSilverlightInsalled method is taken from Petr’s &lt;a href="http://blogs.msdn.com/piotrp/archive/2008/05/07/determining-if-silverlight-is-installed-using-javascript.aspx"&gt;old-but-good post on the subject&lt;/a&gt;.&amp;#160;&amp;#160; I simply added this function to my Silverlight.js file. &lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; isSilverlightInstalled() {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; isSilverlightInstalled = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,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,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #008000"&gt;//check on IE&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,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,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; slControl = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ActiveXObject('AgControl.AgControl');
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            isSilverlightInstalled = &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,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (e) {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #008000"&gt;//either not installed or not IE. Check Firefox&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (navigator.plugins[&amp;quot;&lt;span style="color: #8b0000"&gt;Silverlight Plug-In&lt;/span&gt;&amp;quot;]) {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                isSilverlightInstalled = &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,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (e) {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #008000"&gt;//we don't want to leak exceptions. However, you may &lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #008000"&gt;//to add exception tracking code here&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; isSilverlightInstalled;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;When we run it from a browser without Silverlight enabled we get the alternate content:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_32.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_15.png" width="244" height="134" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;But with Silverlight installed, we get our beautiful Silverlight application content.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_34.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_16.png" width="244" height="184" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;That is great, but how do we expose the right content?&amp;#160; We want to display exactly the same data as is in the Silverlight app and we want to write as little code as possible.&amp;#160; We really don’t want multiple pages to maintain.&amp;#160;&amp;#160;&amp;#160; So let’s add some very basic code to the page in our AlternativeContent div.&amp;#160;&amp;#160;&amp;#160; This ListView is for Restaurant details.&amp;#160; &lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;ListView&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;RestaurnatDetails&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                &lt;span style="color: #ff0000"&gt;EnableViewState&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;LayoutTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;PlaceHolder&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;ItemPlaceHolder&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;LayoutTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DynamicEntity&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;RestaurnatEntity&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;ListView&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Now we need to bind it to our datasource…&amp;#160;&amp;#160; I find this is pretty easy in the design view in VS.&amp;#160; Note, you do have make the div visible so you can work with it in the designer.&amp;#160; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_36.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_17.png" width="244" height="130" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Then we configure the DataSource.. it is very easy to select the query method we want to use&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image70.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image70_thumb.png" width="421" height="331" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Next we bind the query method parameter based on the routes we defined.&amp;#160; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_74.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_35.png" width="438" height="306" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Now do the exact same thing for our Plates ListView…&amp;#160; &lt;/p&gt;

&lt;p&gt;This gives us some very simple aspx code:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  1:            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;ListView&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;RestaurnatDetails&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  2:                         &lt;span style="color: #ff0000"&gt;EnableViewState&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DataSourceID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;restaurantsDomainDataSource&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  3:                &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;LayoutTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  4:                      &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;PlaceHolder&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;ItemPlaceHolder&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  5:                &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;LayoutTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  6:                &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  7:                     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DynamicEntity&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;RestaurnatEntity&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  8:                &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  9:            &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;ListView&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 10: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 11:            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DomainDataSource&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;restaurantsDomainDataSource&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 12:                               &lt;span style="color: #ff0000"&gt;DomainServiceTypeName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;MyApp.Web.DishViewDomainService&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 13:                               &lt;span style="color: #ff0000"&gt;QueryName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;GetRestaurant&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 14:               &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;QueryParameters&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 15:                  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;RouteParameter&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;id&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;RouteKey&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;restaurantId&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 16:                                   &lt;span style="color: #ff0000"&gt;DefaultValue&lt;/span&gt; =&lt;span style="color: #0000ff"&gt;&amp;quot;-1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Type&lt;/span&gt; = &lt;span style="color: #0000ff"&gt;&amp;quot;Int32&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 17:               &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;QueryParameters&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 18:            &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DomainDataSource&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 19: &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Next we want to enable these controls to dynamically generate the UI based on the data.&amp;#160;&amp;#160; &lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  1:         &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Page_Init(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, EventArgs e)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  2:         {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  3:             RestaurnatDetails.EnableDynamicData(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(MyApp.Web.Restaurant));
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  4:             PlateDetails.EnableDynamicData(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(MyApp.Web.Plate));
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  5:             &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; resId = Page.RouteData.Values[&amp;quot;&lt;span style="color: #8b0000"&gt;restaurant&lt;/span&gt;&amp;quot;] &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  6:             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (resId != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) { Response.Write(&amp;quot;&lt;span style="color: #8b0000"&gt;&amp;lt;script type=text/javascript&amp;gt;window.location.hash='#/Plates';&amp;lt;/script&lt;/span&gt;&amp;quot;+&amp;quot;&lt;span style="color: #8b0000"&gt;&amp;gt;&lt;/span&gt;&amp;quot;); }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  7:         }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  8: &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Notice we added lines 4-5 to enable dynamic data on these two ListViews.&lt;/p&gt;

&lt;p&gt;The last step is we need to add the set of templates &lt;a href="http://www.asp.net/dynamicdata"&gt;DynamicData&lt;/a&gt; uses.&amp;#160; You can grab these from any Dynamic Data project.&amp;#160; Just copy them into the root of the web project.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_42.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_20.png" width="309" height="396" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;You can edit these templates to control exactly how your data is displayed.&lt;/p&gt;

&lt;p&gt;In the EntityTemplates directory we need to templates for each of our entities (Plate and Restaurant in this case).&amp;#160; This will control how they are displayed.&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  1: &lt;span style="background-color: #ffff00; color: black"&gt;&amp;lt;%@ Control Language=&amp;quot;C#&amp;quot; CodeBehind=&amp;quot;Restaurant.ascx.cs&amp;quot; Inherits=&amp;quot;MyApp.Web.RestaurantEntityTemplate&amp;quot; %&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  2: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  3:       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DynamicControl&lt;/span&gt;  &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;DynamicControl8&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DataField&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;ImagePath&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  4:       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ul&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;restaurant&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  5:       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  6:          &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ul&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;restaurantDetails&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  7:              &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;h2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DynamicControl&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;NameControl&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DataField&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Name&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;h2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  8:              &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DynamicControl&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;DynamicControl1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DataField&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;ContactName&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DynamicControl&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;DynamicControl2&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DataField&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;ContactTitle&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;)&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  9:              &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DynamicControl&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;DynamicControl3&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DataField&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Address&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 10:              &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DynamicControl&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;DynamicControl4&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DataField&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;City&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DynamicControl&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;DynamicControl5&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DataField&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Region&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DynamicControl&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;DynamicControl6&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DataField&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;PostalCode&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;           
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 11:              &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;DynamicControl&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;DynamicControl7&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DataField&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Phone&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;           
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 12:              &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;HyperLink&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;link&amp;quot;&lt;/span&gt;  &lt;span style="color: #ff0000"&gt;NavigateUrl&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;&amp;lt;%#GetDetailsUrl() %&amp;gt;&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;details..&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;asp&lt;/span&gt;:&lt;span style="color: #800000"&gt;HyperLink&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 13:          &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ul&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 14:       &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 15:       &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ul&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 16: &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Notice here as well, we are only doing some basic formatting and just mentioning the fields we want to appear&amp;#160; in the alternate content.&amp;#160;&amp;#160;&amp;#160; Repeat for Plate..&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Now we are ready to run it.&lt;/p&gt;

&lt;p&gt;At the root, with no query string parameters we get the list of restaurants, all in HTML of course.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_46.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_22.png" width="377" height="262" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;then we can add the routs to narrow down to one plate at a given restaurant.&amp;#160; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_76.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_36.png" width="336" height="286" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;But, let’s look at this in a real browser, to be sure we know what this looks like to a search engine.&amp;#160; &lt;a href="http://en.wikipedia.org/wiki/Lynx_(web_browser)"&gt;Lynx&lt;/a&gt; lives!&amp;#160; Lynx was the first web browser I used back in 1992 on my DEC2100 machine in the Leazar lab on the campus of North Carolina State University.. And it still works just as well today.&amp;#160; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_48.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_23.png" width="434" height="291" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;and the details&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_50.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_24.png" width="434" height="291" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This classic text based browser shows us just the text – just what the search engines crawlers will see.&amp;#160; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Now for the real test.&amp;#160;&amp;#160; &lt;/p&gt;

&lt;p&gt;We will use Bing for &lt;a href="http://www.bing.com/search?q=my+foodie+Explorer+Cooking+Class+with+Joe..&amp;amp;src=IE-SearchBox&amp;amp;FORM=IE8SRC"&gt;“my foodie Explorer Cooking Class with Joe..”&lt;/a&gt;&amp;#160; and sure enough, it is there:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_56.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_27.png" width="482" height="325" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Clicking on the link?&lt;/p&gt;

&lt;p&gt;..takes is to exactly the right page with the right data in our nice Silverlight view.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_58.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_thumb_28.png" width="452" height="314" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Of course this works with &lt;a href="http://www.google.com/#hl=en&amp;amp;source=hp&amp;amp;q=my+foodie+Explorer+Cooking+Class+with+Joe..&amp;amp;btnG=Google+Search&amp;amp;aq=f&amp;amp;aqi=&amp;amp;aql=&amp;amp;oq=my+foodie+Explorer+Cooking+Class+with+Joe..&amp;amp;fp=f55f94328208dcc1"&gt;the other guys search engine equally well&lt;/a&gt;… if you are the type who uses that one ;-)&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Summary&lt;/h3&gt;

&lt;p&gt;What you have seen here is are the basics of how to create a data driven Silverlight web application that is SEO ready!&amp;#160; We walked through three fun-and-easy steps:&lt;/p&gt;

&lt;li&gt;Step 1: Make app important content deep linkable &lt;/li&gt;

&lt;li&gt;Step 2: Let the search engines know about all those deep links via a Sitemap &lt;/li&gt;

&lt;li&gt;Step 3: Provide “down level” version of important content 
  &lt;p&gt;&amp;#160;&lt;/p&gt;

  &lt;p&gt;Enjoy!&amp;#160; &lt;/p&gt;

  &lt;p&gt;&lt;/p&gt;

  &lt;p&gt;For more information see:&amp;#160; &lt;a href="http://www.bing.com/community/blogs/webmaster/archive/2010/03/05/illuminating-the-path-to-seo-for-silverlight.aspx"&gt;Illuminating the path to SEO for Silverlight&lt;/a&gt;&lt;/p&gt;

  &lt;p&gt;&lt;/p&gt;

  &lt;p&gt;&lt;/p&gt;
&lt;/li&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9975103" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/Mix10/">Mix10</category></item><item><title>Silverlight 4 + RIA Services: Ready for Business: Updating Data in the Client</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/16/silverlight-4-ria-services-ready-for-business-updating-data-in-the-client.aspx</link><pubDate>Tue, 16 Mar 2010 22:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9974986</guid><dc:creator>BradA</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9974986</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/16/silverlight-4-ria-services-ready-for-business-updating-data-in-the-client.aspx#comments</comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;To &lt;a href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx"&gt;continue our series&lt;/a&gt;, let’s look at updating the data.&amp;#160; I have created a Plates.xaml page with very similar structure to the above.&amp;#160;&amp;#160;&amp;#160; For details on how I created this page, check out &lt;a href="http://blogs.msdn.com/brada/archive/2009/11/27/pdc09-talk-building-amazing-business-applications-with-silverlight-4-ria-services-and-visual-studio-2010-now-in-visual-basic.aspx"&gt;my PDC 09 demo walk through.&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[105].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_thumb[49]" border="0" alt="image_thumb[49]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B49%5D_3d4f742f-7a60-4193-a707-9870f4807168.png" width="380" height="132" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now let’s look at updating the Plate data.. &lt;/p&gt;  &lt;p&gt;First we will create some default “form” UI by dragging an entity from the datasources window in much the same way we did above.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[108].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_thumb[50]" border="0" alt="image_thumb[50]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B50%5D_1ba0bf9d-540d-422a-992c-ce121aa589d9.png" width="302" height="314" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;But before we create the UI, notice the order of the fields – it matches the order they will be generated in the UI. They are in alphabetic order, but that is not always what you want.&amp;#160; For example, I think Name should be first. &lt;/p&gt;  &lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[112].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_thumb[52]" border="0" alt="image_thumb[52]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B52%5D_68ad1d86-5085-4e51-bc53-83f980e92e88.png" width="135" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;To address this, in the server project, open the DishViewService.metadata.cs file and add the Display attribute to the Name field of the Plate class.&amp;#160; While we are in there, “Number Updates” isn’t such a good name to use in the UI, so let’s update that as well to something more readable.&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;[Display(Order = 0)]
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,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; Name { &lt;span style="color: #0000ff"&gt;get&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,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;[Display(Name=&amp;quot;&lt;span style="color: #8b0000"&gt;Update Count&lt;/span&gt;&amp;quot;)]
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Nullable&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt; NumberUpdates { &lt;span style="color: #0000ff"&gt;get&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,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Now, flipping back to the client project, we see Name on the top&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[116].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_thumb[54]" border="0" alt="image_thumb[54]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B54%5D_8552e0f1-c190-4a1e-9ea0-d686fe5bbbe1.png" width="140" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;and when we drop it on the form, we see Update Count.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[119].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_thumb[55]" border="0" alt="image_thumb[55]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B55%5D_1aa63654-abf2-437d-a1f9-c430fec9819b.png" width="244" height="237" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Now we have a form, and it is already wired up to the same datasource as the grid.&amp;#160; So let’s add a button the save changes.&lt;/p&gt;

&lt;p&gt;So let’s add a save button to the form&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[122].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_thumb[56]" border="0" alt="image_thumb[56]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B56%5D_85dbe12c-c04d-42b1-a458-3f06626e5bd5.png" width="244" height="116" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;and wire up its Command property (this gets called when the button is pressed).&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[125].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_thumb[57]" border="0" alt="image_thumb[57]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B57%5D_b6debbec-2356-44af-b7fb-f527a37d45ca.png" width="236" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Now, we need to wire this up to the Submit command on the DomainDataSource.&amp;#160; So we use element-to-element binding.&amp;#160; Select the platDomainDataSource&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[135].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_thumb[61]" border="0" alt="image_thumb[61]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B61%5D_fafa96d8-869d-4f88-b1a7-45aa3963f9b7.png" width="244" height="144" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Then select the path to the SubmitChangesCommand&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[139].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_thumb[63]" border="0" alt="image_thumb[63]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B63%5D_8b167d55-3e38-48d9-aacc-2129dd0be72e.png" width="244" height="138" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;You know you have the right, if the button gets disabled (even on the design surface.. after all, there are no changes to submit, right)?&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[142].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_thumb[64]" border="0" alt="image_thumb[64]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B64%5D_41c50a72-1091-4216-ad47-6bba27c43093.png" width="244" height="133" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Now, run it and see the results&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[147].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_thumb[67]" border="0" alt="image_thumb[67]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B67%5D_3ebd7b21-e704-41ef-a362-f4bc7da3944e.png" width="244" height="207" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Notice as you change selection in the grid, the details UI is automatically updated, no coded needed.&amp;#160; Also notice that the save button is disabled until there are changes that need to be submitted to the server..&amp;#160; Try adding a “Cancel” button?&amp;#160; to remove the local changes.&amp;#160; it is very easy to wire up to the RejectChangesCommand in the same way.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Now, let’s see about actually update the data in the database.&amp;#160;&amp;#160; Set a break point in the&amp;#160; make edits to two different entities on the &lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[151].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_thumb[69]" border="0" alt="image_thumb[69]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B69%5D_019d031f-e92b-4e04-9d2a-1f2b8f4b6bcd.png" width="244" height="137" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Notice this update method get’s called twice once for each entity changed on he client.&amp;#160; &lt;/p&gt;

&lt;p&gt;Now let’s add a little more logic to the update to handle some business logic&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  1:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; UpdatePlate(Plate currentPlate)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  2:         {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  3:             currentPlate.NumberUpdates++;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  4: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  5:             var orginal = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ChangeSet.GetOriginal(currentPlate);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  6: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  7:             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (orginal.Price != currentPlate.Price)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  8:             {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  9:                 &lt;span style="color: #008000"&gt;// add 1 dollar fee for changing price&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 10:                 currentPlate.Price += 1; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 11:             }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; 12:         }&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;First line 3, we update the NumberUpdates count, then if the price of this menu item is changing, we add a one dollar fee.&amp;#160; Notice we can easily check to see if this value is changed from the prospective of this client by using the client’s original value… The client sends to the server the original value it got from the server when it was first loaded for any field that changed, is a key or marked as a concurrency token.&amp;#160; (This is a small tweak from the last release when *all* original values were sent back the server).&amp;#160;&amp;#160;&amp;#160; For example, on an update that only changes the Calorie count, inspecting the original value, we see:&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[167].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_thumb[77]" border="0" alt="image_thumb[77]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B77%5D_daf79650-0dfa-4c30-a0f1-9760b2699dd8.png" width="244" height="136" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;If you wanted to include Price on any update, you need to mark it as a concurrency token. To mark an field as a concurrency token in entity framework, select the field in the designer and change the Concurrency Mode to “Fixed”&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[158].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_thumb[72]" border="0" alt="image_thumb[72]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B72%5D_64cfe6cb-0c27-4972-a7c5-558ebd89e23d.png" width="244" height="234" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[157].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_thumb[71]" border="0" alt="image_thumb[71]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B71%5D_f0b42a6b-5ead-4fbb-aca6-1cbfa0a25a34.png" width="244" height="222" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;With this change the original value for price will always be sent to the server… this is only a tiny bit more expensive for most fields, so I recommend doing it whenever the business logic requires it.&amp;#160; &lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[171].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_thumb[79]" border="0" alt="image_thumb[79]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessU_A057/image_thumb%5B79%5D_bf56daef-8859-4d59-911b-0820a0b4dbe1.png" width="244" height="129" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9974986" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/Mix10/">Mix10</category></item><item><title>Silverlight 4 + RIA Services - Ready for Business: Exposing OData Services</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/16/silverlight-4-ria-services-ready-for-business-exposing-odata-services.aspx</link><pubDate>Tue, 16 Mar 2010 17:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9975332</guid><dc:creator>BradA</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9975332</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/16/silverlight-4-ria-services-ready-for-business-exposing-odata-services.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/image_23.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 15px 0px 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="left" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/image_thumb.png" width="146" height="52" /&gt;&lt;/a&gt; &lt;a href="http://www.odata.org/"&gt;OData&lt;/a&gt; is an emerging set of extensions for the ATOM protocol that makes it easier to share data over the web. To show off OData in RIA Services, let’s &lt;a href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx"&gt;continue our series&lt;/a&gt;.&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; We think it is very interesting to expose OData from a DomainService to facilitate data sharing.&amp;#160;&amp;#160; For example I might want users to be able to access my data in a rich way in Excel as well as my custom Silverlight client.&amp;#160;&amp;#160; I’d like to be able to enable that without writing multiple services or duplicating any business or data access logic.&amp;#160; &lt;/p&gt;  &lt;p&gt;This is very easy to enable with RIA Services.&amp;#160; In fact it is just a check box away!&amp;#160;&amp;#160;&amp;#160; When you create your DomainService simply check the “Expose OData endpoint” and that will expose your DomainService as an OData feed.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/image_thumb_1.png" width="316" height="384" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If you have already created a DomainService it is easy to enable OData on it as well by doing the two things this wizard does.&amp;#160; &lt;/p&gt;  &lt;p&gt;First, it adds an endpoint to the domainServices section of the web.config.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;system.serviceModel&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;domainServices&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;endpoints&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;OData&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;             &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;System.ServiceModel.DomainServices.Hosting.ODataEndpointFactory, System.ServiceModel.DomainServices.Hosting.OData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;endpoints&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;domainServices&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Second, on each paramaterless query methods you wish to expose via OData, mark the query as being default.&amp;#160; Meaning any time there is an ask for “Plate” it is this query method that is used.&amp;#160; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        [Query(IsDefault = &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,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IQueryable&amp;lt;Plate&amp;gt; GetPlates()
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;once these are done, you an hit the service and see an Atom feed.&amp;#160; The format of the URL is the namespace+typename for the domainservice with dots replaced by dashs followed by “.svc/Odata/”.&amp;#160; So if the DomainService class is &lt;/p&gt;

&lt;p&gt;MyApp.Web.DishViewDomainService then the URL would be &lt;a title="http://localhost:30045/myapp-web-DishViewDomainService.svc/OData/" href="http://localhost:30045/myapp-web-DishViewDomainService.svc/OData/"&gt;http://localhost:30045/myapp-web-DishViewDomainService.svc/OData/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a title="http://localhost:30045/myapp-web-DishViewDomainService.svc/OData/PlateSet" href="http://localhost:30045/myapp-web-DishViewDomainService.svc/OData/PlateSet"&gt;http://localhost:30045/myapp-web-DishViewDomainService.svc/OData/PlateSet&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/image_thumb_3.png" width="646" height="258" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;And then drill in with this URL: &lt;a href="http://localhost:30045/myapp-web-DishViewDomainService.svc/OData/PlateSet"&gt;http://localhost:30045/myapp-web-DishViewDomainService.svc/OData/PlateSet&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/image_10.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/image_thumb_4.png" width="568" height="420" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;That is really cool that the data is in an open ATOM based format… but what is even better is there is a budding ecosystem of clients that can consume this feed.&amp;#160; One of the more interesting ones is the Excel addin called &lt;a href="http://www.powerpivot.com/"&gt;PowerPivot&lt;/a&gt;.&amp;#160; &lt;/p&gt;

&lt;p&gt;Once you have it installed with Excel 2010. select the PowerPivot window&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/image_thumb_5.png" width="528" height="216" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/image_thumb_6.png" width="574" height="208" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/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="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/image_thumb_7.png" width="420" height="361" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/image_18.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/image_thumb_8.png" width="409" height="352" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/image_20.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/image_thumb_9.png" width="428" height="368" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/image_22.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_148C8/image_thumb_10.png" width="588" height="352" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Then you can use the full power of excel so if i want to sort by Number of Updates, with a rating of 4 or higher, with calorie count between 3000 and 4000 then go graph that in some interesting way, you can do the easily..&amp;#160; All with the live data without any custom application code.&amp;#160; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;What we showed in this walk though is how to expose OData from your DomainService and consume that in Excel.&amp;#160; This is just a down payment on the OData support coming in the future in RIA Services.&amp;#160; &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9975332" width="1" height="1"&gt;</description></item><item><title>Silverlight 4 + RIA Services - Ready for Business: Consuming Data in the Silverlight Client</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-consuming-data-in-the-silverlight-client.aspx</link><pubDate>Tue, 16 Mar 2010 05:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9974983</guid><dc:creator>BradA</dc:creator><slash:comments>24</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9974983</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-consuming-data-in-the-silverlight-client.aspx#comments</comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;To &lt;a href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx"&gt;continue our series&lt;/a&gt;, let’s see where the fun comes in my look at how easy that is to consume from the client.&amp;#160; First just to help you understand what is happening behind the covers, let’s look at a code-behind solution.&amp;#160; In View\Home.xaml put a simple DataGrid on the form.&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;sdk&lt;/span&gt;:&lt;span style="color: #800000"&gt;DataGrid&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;dataGrid1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Height&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;152&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;692&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Then add these lines of code to Home.xaml.cs&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  1: var context = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DishViewDomainContext();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  2: &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.dataGrid1.ItemsSource = context.Restaurants;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  3: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  4: context.Load(context.GetRestaurantsQuery());
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  5: &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;In line 1, we create a DishViewDomainContext… notice this is the automatically generated (via an MSBuild task) from the DishViewDomainService on the server.&amp;#160; &lt;/p&gt;

&lt;p&gt;In line 2, Notice we have a Restaurants property – we provide this because there is at least one query method that returns restaurants.&amp;#160; Notice the cool binding magic, we have not yet populated this data from the server, but we go ahead and bind it.&amp;#160; This avoids any kind of complex callback logic.&amp;#160; &lt;/p&gt;

&lt;p&gt;In line 4, we explicitly load the data.. this is the network call, so we want to make sure it is clear to the developer when this happening.&amp;#160;&amp;#160; As an argument we pass exactly which query method (and any arguments) to use. &lt;/p&gt;

&lt;p&gt;Now we run it and we get our data.. &lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[42].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_thumb[20]" border="0" alt="image_thumb[20]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B20%5D_09e30fb9-78ad-43ac-996f-e9b6301cf23a.png" width="244" height="119" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Very painless, but it gets even easier ;-)&lt;/p&gt;

&lt;p&gt;Go and in delete this code and the Xaml..&amp;#160; Then notice the DataSources window&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[172].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_thumb[80]" border="0" alt="image_thumb[80]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B80%5D_51085374-3f81-46b3-9736-1ae3a689cdcc.png" width="320" height="113" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[48].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_thumb[22]" border="0" alt="image_thumb[22]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B22%5D_7c4819ed-f367-497f-843a-88007982a098.png" width="204" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Notice this is simply a visual representation of exactly what we were doing in code.&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[51].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_thumb[23]" border="0" alt="image_thumb[23]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B23%5D_a21c3679-4c20-409e-b27d-e8c1390b33fc.png" width="231" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Notice i can change what default UI to generate and which query method to use.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Dragging Restaurants to the form and bingo, we have our data. &lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[56].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_thumb[26]" border="0" alt="image_thumb[26]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B26%5D_c9bea7d5-f5c0-4387-92c1-d27702841db4.png" width="244" height="119" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Run it and we have our data… what could be easier?&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[60].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_thumb[28]" border="0" alt="image_thumb[28]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B28%5D_2e040b8b-cf4a-46a3-b5af-1631d9371aca.png" width="244" height="164" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Click on the column headers – notice sorting works!&amp;#160; There is no code you had to write on the client or server to enable it.&amp;#160; This just comes for free out of returning an IQuerable.&amp;#160; &lt;/p&gt;

&lt;p&gt;Now let’s add paging.. &lt;/p&gt;

&lt;p&gt;First we drag and drop the DataPager control to the form, then do a bit of layout and we end up with something that looks nice&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[63].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_thumb[29]" border="0" alt="image_thumb[29]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B29%5D_d6c9a067-f9e2-46ce-a86b-eca5ee9ede3a.png" width="244" height="122" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;But we still need to wireup the DataPager to the same underlying DataSource.&amp;#160; This is easy enough done by draging and dropping the same Restaurant element from the DataSources window to the DataPager.&amp;#160; You will now you did this right if the DataPager becomes enabled.&amp;#160; &lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[70].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_thumb[32]" border="0" alt="image_thumb[32]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B32%5D_0222be4a-e30c-4d71-83bb-adae068c9937.png" width="244" height="121" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[74].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_thumb[34]" border="0" alt="image_thumb[34]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B34%5D_5772ae1b-6285-4bdb-a655-f43263796f55.png" width="244" height="151" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Notice that paging works great!&amp;#160; No code needed on the client or the server, again, all done through using that simple Linq query we wrote on the server. But what about paging AND sorting… do they work well together?&amp;#160; Will it just sort the page of data that is loaded locally?&amp;#160; The answer of course is that sorting and paging compose nicely together and the sort is actually sent all the way to the data tier and executed there in a very efficient way.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Now let’s add filtering.&amp;#160; With just a bit more work in the UI, we can add a way to filter by postal code.&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;sdk&lt;/span&gt;:&lt;span style="color: #800000"&gt;Label&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;label1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Content&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Postal Code:&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;FontSize&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;14&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Margin&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;0,0,462,13&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;TextBox&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Height&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;23&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;HorizontalAlignment&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Left&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Margin&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;110,12,0,0&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;postalCodeTextbox&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;VerticalAlignment&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Top&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;120&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[78].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_thumb[36]" border="0" alt="image_thumb[36]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B36%5D_3f539b56-17f9-4529-aefe-6c852f11b7c5.png" width="244" height="80" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Then we need to wire this up to the query.&amp;#160; Of course we want the filter applied as close to the data as possible.&amp;#160; We don’t want to download all the entities locally, then filter, nor do we want to pull them all to the middle-tier and then filter.&amp;#160; What we want is for the filter to be applied at the database level.&amp;#160; Luckily this is very easy to do with LINQ composition.&amp;#160; &lt;/p&gt;

&lt;p&gt;First we select the DomainDataSource in the Document Outline view.&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[81].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_thumb[37]" border="0" alt="image_thumb[37]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B37%5D_f89ab7de-c999-43d4-8555-02f311042a77.png" width="232" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[84].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_thumb[38]" border="0" alt="image_thumb[38]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B38%5D_e40b9599-0078-41ca-8bd6-40f6b351677d.png" width="244" height="240" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[88].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_thumb[40]" border="0" alt="image_thumb[40]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B40%5D_44c34c14-e265-4bf5-ba10-92cb0cf03692.png" width="244" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Operator – typically you should set this to “Contains”.&amp;#160; If you use the default of “IsEqualTo” the first load (when there is no filter) will result in no results returned.&amp;#160; &lt;br /&gt;PropertyPath – this is the property on the entity that you are filtering on… Just type in the simple name.&amp;#160; &lt;br /&gt;Value – this is where to get the value to compare from.&amp;#160; It is easiest to do UI-to-UI binding to the TextBox’s Text property.&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[92].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_thumb[42]" border="0" alt="image_thumb[42]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B42%5D_11e77059-9749-4c40-9b7d-b0583059ba6c.png" width="244" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Here is the dialog once we are done:&lt;/p&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[96].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_thumb[44]" border="0" alt="image_thumb[44]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B44%5D_f49870dd-dbe2-4208-a7c4-4681c00d7ecf.png" width="244" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;And the resulting Xaml:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;riaControls&lt;/span&gt;:&lt;span style="color: #800000"&gt;DomainDataSource&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;restaurantDomainDataSource&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;AutoLoad&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;True&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                                      &lt;span style="color: #ff0000"&gt;d&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;DesignData&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;{d:DesignInstance my:Restaurant, 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                                                     CreateList=true}&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                                      &lt;span style="color: #ff0000"&gt;Height&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;0&amp;quot;&lt;/span&gt;  &lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;0&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                                      &lt;span style="color: #ff0000"&gt;LoadedData&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;restaurantDomainDataSource_LoadedData_1&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                                      &lt;span style="color: #ff0000"&gt;QueryName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;GetRestaurantsQuery&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;riaControls&lt;/span&gt;:&lt;span style="color: #800000"&gt;DomainDataSource.FilterDescriptors&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;riaControls&lt;/span&gt;:&lt;span style="color: #800000"&gt;FilterDescriptor&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Operator&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Contains&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                                              &lt;span style="color: #ff0000"&gt;PropertyPath&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;PostalCode&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                                              &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;{Binding ElementName=postalCodeTextbox, Path=Text}&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;riaControls&lt;/span&gt;:&lt;span style="color: #800000"&gt;DomainDataSource.FilterDescriptors&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;riaControls&lt;/span&gt;:&lt;span style="color: #800000"&gt;DomainDataSource.DomainContext&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;                &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;my&lt;/span&gt;:&lt;span style="color: #800000"&gt;DishViewDomainContext&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;riaControls&lt;/span&gt;:&lt;span style="color: #800000"&gt;DomainDataSource.DomainContext&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;riaControls&lt;/span&gt;:&lt;span style="color: #800000"&gt;DomainDataSource&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[101].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_thumb[47]" border="0" alt="image_thumb[47]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessC_9F6E/image_thumb%5B47%5D_3656c10b-132a-4867-a536-2a4f6bbe08fb.png" width="244" height="161" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Notice no code changes at all, and no changes to the business logic in the DomainService in particular.&amp;#160; &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9974983" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/Mix10/">Mix10</category></item><item><title>Silverlight 4 + RIA Services - Ready for Business: Exposing Data from Entity Framework</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-exposing-data-from-entity-framework.aspx</link><pubDate>Tue, 16 Mar 2010 05:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9974982</guid><dc:creator>BradA</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9974982</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-exposing-data-from-entity-framework.aspx#comments</comments><description>&lt;P&gt;To &lt;A href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx" mce_href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx"&gt;continue our series&lt;/A&gt; I wanted to look next at how to expose your data from the server side of your application.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The interesting data in your business applications come from a wide variety of data sources.&amp;nbsp; From a SQL Database, from Oracle DB, from Sql Azure, from Sharepoint, from a mainframe and you have likely already chosen a datamodel such as NHibernate, Linq2Sql, Entity Framework, Stored Proc, a service.&amp;nbsp;&amp;nbsp; The goal of RIA Service in this release is to make it easy to work with data from any (or many) of the sources in a seamless way from a Silverlight application.&amp;nbsp; This walk through will use Entity Framework accessing the Sql Express database, but the basic concept applies to any data source.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Add DishView.mdf to BusinessApplication1.Web\App_Data – Of course in a real world example, you’d just have a connection string to an existing database.&lt;/P&gt;
&lt;P&gt;Then create an Entity Framework model on top of it.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;A href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[25].png" mce_href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[25].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_thumb[13] border=0 alt=image_thumb[13] src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_9ED9/image_thumb%5B13%5D_75707ca1-186f-4222-9064-25acd29550b0.png" width=244 height=166 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_9ED9/image_thumb%5B13%5D_75707ca1-186f-4222-9064-25acd29550b0.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;As you can see, we have a very simple Entity set.. each Restaurant can have any number of Plates. &lt;/P&gt;
&lt;P&gt;&lt;A href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[28].png" mce_href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[28].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_thumb[14] border=0 alt=image_thumb[14] src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_9ED9/image_thumb%5B14%5D_692f1685-2626-4899-a2b4-5bcf2ced3a39.png" width=241 height=244 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_9ED9/image_thumb%5B14%5D_692f1685-2626-4899-a2b4-5bcf2ced3a39.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Next, we need to write some business logic that controls and shapes how to data is seen by the Silverlight client.&amp;nbsp; To do that, we add a new DomainService.&amp;nbsp; A DomainService is simply a special kind of WCF service that makes it MUCH easier to query, update, secure and validate your data.&amp;nbsp;&amp;nbsp;&amp;nbsp; But if you are a WCF expert and know all the ins-and-outs of configuring a WCF service, you can certainly customize this service in exactly the same way to match your needs.&amp;nbsp;&amp;nbsp; Of course, in the 90% case we hope you will not need to do that. &lt;/P&gt;
&lt;P&gt;&lt;A href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[31].png" mce_href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[31].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_thumb[15] border=0 alt=image_thumb[15] src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_9ED9/image_thumb%5B15%5D_4b5aa0eb-045a-49df-a07a-017eb73148c1.png" width=244 height=122 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_9ED9/image_thumb%5B15%5D_4b5aa0eb-045a-49df-a07a-017eb73148c1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Next we are given a chance to pre-populate the DomainService.&lt;/P&gt;
&lt;P&gt;&lt;A href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[38].png" mce_href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[38].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_thumb[18] border=0 alt=image_thumb[18] src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_9ED9/image_thumb%5B18%5D_85fc937a-7b47-4e97-a6c0-ee5bdb625cef.png" width=201 height=244 mce_src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessE_9ED9/image_thumb%5B18%5D_85fc937a-7b47-4e97-a6c0-ee5bdb625cef.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;In this case, we will expose Plate and Restaurant, but only Plate will be updatable.&amp;nbsp;&amp;nbsp;&amp;nbsp; We will also generate a metadata class for hanging validation attributes on so that you can regenerate the EF model without losing any customizations.&amp;nbsp;&amp;nbsp;&amp;nbsp; We get a starter DishViewDomainService class.&amp;nbsp; I have updated it in lines 8-9 with a bit of business logic.&amp;nbsp;&amp;nbsp; Let’s walk through each line..&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;  1:     [EnableClientAccess]
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  2:     &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; DishViewDomainService : LinqToEntitiesDomainService&amp;lt;DishViewEntities&amp;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;  3:     {
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  4: 
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  5:         &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; IQueryable&amp;lt;Restaurant&amp;gt; GetRestaurants()
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  6:         {
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  7:             &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.ObjectContext.Restaurants
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt;  8:                 .Where (r=&amp;gt;r.Region != "&lt;SPAN style="COLOR: #8b0000"&gt;NC&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;  9:                 .OrderBy(r=&amp;gt;r.ID);
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 12px"&gt; 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; 11: &lt;/PRE&gt;&lt;/PRE&gt;
&lt;P&gt;Line 1: This attribute marks the DomainService as accessible over http, without it, the service is only callable from in process. This is useful in the ASP.NET WebForms\Dynamic Data scenario.&amp;nbsp; &lt;BR&gt;Line 2: We drive this class from the LinqToEntitiesDomainService this is a utility class that provides a few helpers for working with EF.&amp;nbsp;&amp;nbsp;&amp;nbsp; The real work is done by the DomainService base class, this is the class you derive from for POCO and other custom scenarios. &lt;BR&gt;line 5: Notice we are returning a IQueryable of our DAL Restaurant type.&amp;nbsp; IQuerable is the interface LINQ is built on.&amp;nbsp; This enables query capablities from the client so you can do things like sorting, paging, filtering from the client and have it compose with your custom business logic and execute on the data tier..&amp;nbsp; This means no extra data is sucked into the mid-tier or the client, but you don’t have gunk up your business logic to deal with that.&amp;nbsp; &lt;BR&gt;Line 8-9: we have some&amp;nbsp; business logic that weeds out any Restaurant in North Carolina and puts a default ordering on the results. You can of course imagine more interesting business logic.&amp;nbsp; &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9974982" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/Mix10/">Mix10</category></item><item><title>Silverlight 4 + RIA Services - Ready for Business: Starting a New Project with the Business Application Template</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-starting-a-new-project-with-the-business-application-template.aspx</link><pubDate>Mon, 15 Mar 2010 23:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9974981</guid><dc:creator>BradA</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9974981</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-starting-a-new-project-with-the-business-application-template.aspx#comments</comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;To kick &lt;a href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx"&gt;off our series,&lt;/a&gt; I wanted to focus on our goal of helping you focus on your business, not plumbing code.&amp;#160; The first place you will see this in the pre-build components in the Business Application Template.&amp;#160; It describes a prescriptive application structure, looks great and is easily customizable.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;After you have successfully installed Silverlight 4 for developers (which includes RIA Services) you will have a couple of new projects in the Silverlight section.&amp;#160; We are going to focus on the Business Application Template. &lt;/p&gt;  &lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[3].png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image_thumb[1]" border="0" alt="image_thumb[1]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_9E68/image_thumb1.png" width="392" height="266" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Notice this creates a single solution with two projects.&amp;#160; BusinessApplication1 is the client part of the application and BusinessApplication2 is the server part.&amp;#160; These are related projects that know about each other.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/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_thumb[4]" border="0" alt="image_thumb[4]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_9E68/image_thumb%5B4%5D_c4275cb0-3971-467c-a93f-ef9e43800709.png" width="210" height="434" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And by default you get the framework for a great looking, professional application&lt;/p&gt;  &lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/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_thumb[6]" border="0" alt="image_thumb[6]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_9E68/image_thumb%5B6%5D_4abfce25-6921-4b15-ac99-0aad42a57465.png" width="244" height="188" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The starter application is fully localizable and customizable.&amp;#160;&amp;#160; For example, I want to change the name of the application from “Application Name” to My Foodie Explorer.&amp;#160; This is easily done in the Assets\Resources directory be editing the ApplicationStrings.resx file.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[17].png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image_thumb[9]" border="0" alt="image_thumb[9]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_9E68/image_thumb9.png" width="436" height="170" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="file:///C:/Users/brada/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles289814C/image[21].png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image_thumb[11]" border="0" alt="image_thumb[11]" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_9E68/image_thumb11.png" width="481" height="270" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Check out a &lt;a href="http://blogs.msdn.com/brada/archive/2009/07/10/amazing-business-apps-example-updated-for-silverlight-3-rtm-and-net-ria-services-july-update.aspx"&gt;deeper walk through&lt;/a&gt;, it is a bit older, but it is still valid and Tim recently posted &lt;a href="http://timheuer.com/blog/archive/2010/03/11/silverlight-application-theme-preview-sneak-peek-template.aspx"&gt;SNEAK PEEK: New Silverlight application themes&lt;/a&gt; such as:&lt;/p&gt;  &lt;p&gt;&lt;img title="Grayscale Silverlight Theme" alt="Grayscale Silverlight Theme" src="http://storage.timheuer.com/grayscale-sampleapp.jpg" /&gt;&lt;/p&gt;  &lt;p&gt;enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9974981" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/Mix10/">Mix10</category></item><item><title>Silverlight 4 + RIA Services - Ready for Business: Index</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx</link><pubDate>Mon, 15 Mar 2010 22:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9975083</guid><dc:creator>BradA</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9975083</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx#comments</comments><description>&lt;P&gt;With &lt;A href="http://silverlight.net/getstarted/silverlight-4/" mce_href="http://silverlight.net/getstarted/silverlight-4/"&gt;Silverlight 4&lt;/A&gt; and &lt;A href="http://silverlight.net/getstarted/riaservices/" mce_href="http://silverlight.net/getstarted/riaservices/"&gt;RIA Services&lt;/A&gt; all-but done, I thought it would be worthwhile to highlight some of the key features of the platform and tools that make Silverlight a fantastic platform for building business applications.&amp;nbsp;&amp;nbsp;&amp;nbsp; I’ll avoid gratuitous video and dancing hippos and focus on just the bread and butter of business applications:&amp;nbsp; Querying, Updating, Validating and securing your important business-data.&amp;nbsp; I’ll also use this to refresh a few of the posts from my &lt;A href="http://blogs.msdn.com/brada/archive/2009/08/02/business-apps-example-for-silverlight-3-rtm-and-net-ria-services-july-update-summary.aspx" mce_href="http://blogs.msdn.com/brada/archive/2009/08/02/business-apps-example-for-silverlight-3-rtm-and-net-ria-services-july-update-summary.aspx"&gt;Silverlight 3 era series&lt;/A&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The walk through requires:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/teamsystem/default.aspx" mce_href="http://msdn.microsoft.com/en-us/teamsystem/default.aspx"&gt;Visual Studio 2010&lt;/A&gt; (or the free &lt;A href="http://www.microsoft.com/express/" mce_href="http://www.microsoft.com/express/"&gt;express version&lt;/A&gt;) &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://silverlight.net/" mce_href="http://silverlight.net/"&gt;Silverlight 4 Tools&lt;/A&gt; (includes &lt;A href="http://silverlight.net/riaservices/" mce_href="http://silverlight.net/riaservices/"&gt;RIA Services&lt;/A&gt;) &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;You can &lt;A href="http://brad_abrams.members.winisp.net/Projects/Mix10/BusinessApplication1.zip" mce_href="http://brad_abrams.members.winisp.net/Projects/Mix10/BusinessApplication1.zip"&gt;download the completed application&lt;/A&gt;.&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I authored this with Silverlight 4 RC, but I fully expect it to work with Silverlight 4 RTM.&amp;nbsp; &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-starting-a-new-project-with-the-business-application-template.aspx" mce_href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-starting-a-new-project-with-the-business-application-template.aspx"&gt;Starting a New Project with the Business Application Template&lt;/A&gt;&amp;nbsp; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-exposing-data-from-entity-framework.aspx" mce_href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-exposing-data-from-entity-framework.aspx"&gt;Exposing Data from Entity Framework&lt;/A&gt;&amp;nbsp; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-consuming-data-in-the-silverlight-client.aspx" mce_href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-consuming-data-in-the-silverlight-client.aspx"&gt;Consuming Data in the Client&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2010/03/16/silverlight-4-ria-services-ready-for-business-updating-data-in-the-client.aspx" mce_href="http://blogs.msdn.com/brada/archive/2010/03/16/silverlight-4-ria-services-ready-for-business-updating-data-in-the-client.aspx"&gt;Updating Data &lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2010/03/23/silverlight-4-ria-services-ready-for-business-validating-data.aspx" mce_href="http://blogs.msdn.com/brada/archive/2010/03/23/silverlight-4-ria-services-ready-for-business-validating-data.aspx"&gt;Validating Data&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2010/03/26/silverlight-4-ria-services-ready-for-business-authentication-and-personalization.aspx" mce_href="http://blogs.msdn.com/brada/archive/2010/03/26/silverlight-4-ria-services-ready-for-business-authentication-and-personalization.aspx"&gt;Authentication and Personalization&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2010/03/17/silverlight-4-ria-services-ready-for-business-search-engine-optimization-seo.aspx" mce_href="http://blogs.msdn.com/brada/archive/2010/03/17/silverlight-4-ria-services-ready-for-business-search-engine-optimization-seo.aspx"&gt;Silverlight and Search Engine Optimization (SEO)&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2010/03/16/silverlight-4-ria-services-ready-for-business-exposing-odata-services.aspx"&gt;Exposing OData Services&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2010/03/29/silverlight-4-ria-services-ready-for-business-exposing-wcf-wsdl-services.aspx" mce_href="http://blogs.msdn.com/brada/archive/2010/03/29/silverlight-4-ria-services-ready-for-business-exposing-wcf-wsdl-services.aspx"&gt;Exposing WCF (WSDL) Services&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx" mce_href="http://blogs.msdn.com/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-index.aspx"&gt;Exposing JSON Endpoint&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Working with Reference Data - In Progress &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/saurabh/archive/2010/03/16/ria-services-application-deployment.aspx" mce_href="http://blogs.msdn.com/saurabh/archive/2010/03/16/ria-services-application-deployment.aspx"&gt;Deploying to a 3rd Party Hoster&lt;/A&gt; (I could not do any better than Saurabh's post!) &lt;/LI&gt;
&lt;LI&gt;Workflow Integration - In Progress &lt;/LI&gt;
&lt;LI&gt;Management with AppFabric - In Progress &lt;/LI&gt;
&lt;LI&gt;Debugging Tips and Tricks - In Progress&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/brada/archive/2010/03/22/silverlight-4-ria-services-ready-for-business-localizing-business-application.aspx" mce_href="http://blogs.msdn.com/brada/archive/2010/03/22/silverlight-4-ria-services-ready-for-business-localizing-business-application.aspx"&gt;Globalized and Localized&amp;nbsp; &lt;/A&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9975083" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/Mix10/">Mix10</category></item><item><title>Silverlight 4 and RIA Services Release Candidate Available NOW</title><link>http://blogs.msdn.com/b/brada/archive/2010/03/15/silverlight-4-and-ria-services-release-candidate-available-now.aspx</link><pubDate>Mon, 15 Mar 2010 18:18:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9978879</guid><dc:creator>BradA</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9978879</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/03/15/silverlight-4-and-ria-services-release-candidate-available-now.aspx#comments</comments><description>&lt;p&gt;At &lt;a href="http://visitmix.com/"&gt;Mix10&lt;/a&gt; this morning in Vegas ScottGu announced that &lt;a href="http://silverlight.net/getstarted/riaservices/"&gt;Silverlight 4&lt;/a&gt; and &lt;a href="http://silverlight.net/getstarted/riaservices/"&gt;RIA Services RC&lt;/a&gt; are available for download now!&amp;#160; These bits work great with &lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx"&gt;VS2010 RC&lt;/a&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;We have some great videos, and updated samples already posted on &lt;a href="http://silverlight.net/riaservices"&gt;http://silverlight.net/riaservices&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Deepesh has a great list of what is new in this drop&amp;#160; &lt;a href="http://blogs.msdn.com/deepm/archive/2010/03/15/ria-services-rc-and-toolkit-march-2010-now-available.aspx"&gt;RIA Services RC and Toolkit March 2010 now available…&lt;/a&gt; and there is the official forum post from DineshKu &lt;a href="http://forums.silverlight.net/forums/t/167013.aspx"&gt;RIA Services Road to RTW via RC at MIX&lt;/a&gt;.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;p&gt;&lt;strong&gt;INDEI Support:-&lt;/strong&gt; Validation support based on Silverlight 4’s INotifyDataErrorInfo. This is a non-exception-based model and enables async validations more easily. It also helps display errors flagged by the server in the UI. &lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;p&gt;&lt;strong&gt;Spiffier DDS&lt;/strong&gt;: filter/sort/group descriptors support binding; ICommand support for Load/SubmitChanges/RejectChanges&lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;p&gt;&lt;strong&gt;Server throttling:&lt;/strong&gt; you can regulate the per request load on the server / DB by specifying maximum result limit on a query method using the QueryAttribute.ResultLimit property.&lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;p&gt;&lt;strong&gt;AuthorizationContext:&lt;/strong&gt; Similar to ValidationContext, now you have more options for implementing custom authorization rules (e.g. entity-based authorization)&lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;p&gt;&lt;strong&gt;Endpoint configuration support&lt;/strong&gt;: Following the “secure by default” principle, only binary endpoint will be exposed but we have made it really easy to add additional/different endpoints if you plan to use them. &lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;p&gt;&lt;strong&gt;OData endpoint:&lt;/strong&gt; you can point PowerPivot to a DomainService OData endpoint and analyze data by calling the appropriate query method. This is the first step in lighting up OData with RIA Services&lt;/p&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Download the bits now and lets us know what you think!&amp;#160; &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9978879" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/Mix10/">Mix10</category></item><item><title>Tell me about your services…</title><link>http://blogs.msdn.com/b/brada/archive/2010/02/09/tell-me-about-your-services.aspx</link><pubDate>Tue, 09 Feb 2010 18:36:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9960660</guid><dc:creator>BradA</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9960660</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/02/09/tell-me-about-your-services.aspx#comments</comments><description>&lt;p&gt;My team has been doing a little thinking recently about the “services” space.&amp;#160; Basically I have been trying to figure out how folks think about accessing data and business logic across tiers.&amp;#160; What are the ty&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Tellmeaboutyourservices_9510/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Tellmeaboutyourservices_9510/image_thumb.png" width="134" height="162" /&gt;&lt;/a&gt;pes of development projects are services the core thing they are building and for what types of development projects are services simply pluming for getting the job done?&lt;/p&gt;  &lt;p&gt;I’d love to have you folks chime into this conversation.&amp;#160;&amp;#160; For starters, I have posted a very simple\quick survey.&amp;#160;&amp;#160;&amp;#160; Please &lt;a href="http://twtpoll.com/yhlxuk"&gt;take 30 secs and fill it out&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;What statement best describes the type of work you typically do? (check all that apply)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;1 - I write applications that happen to span across multiple tiers. My code runs on the web server and I also own the client.     &lt;br /&gt;2- I write servers that expose data that third-party developers will consume.      &lt;br /&gt;3- I write clients that consume data from third-party data sources.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a href="http://twtpoll.com/yhlxuk"&gt;Fill out the survey&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9960660" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/-NET+Framework/">.NET Framework</category></item><item><title>Great RIA Services Overview in Dr. Dobbs</title><link>http://blogs.msdn.com/b/brada/archive/2010/01/17/great-ria-services-overview-in-dr-dobbs.aspx</link><pubDate>Mon, 18 Jan 2010 02:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9949620</guid><dc:creator>BradA</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9949620</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2010/01/17/great-ria-services-overview-in-dr-dobbs.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://weblogs.asp.net/dwahlin/"&gt;Dan Wahlin&lt;/a&gt; has a great introductory article on &lt;a href="http://www.ddj.com/windows/222300375"&gt;RIA Services in Dr. Dobbs&lt;/a&gt;&amp;nbsp;and in &lt;a href="http://www.informationweek.com/news/development/tools/showArticle.jhtml?articleID=222301012"&gt;Information Weekly&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.ddj.com/windows/222300375"&gt;&lt;img title="image" alt="image" src="http://weblogs.asp.net/blogs/dwahlin/image_7203E24C.png" width="269" border="0" height="386" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9949620" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category></item><item><title>Visual Studio Project Sample Loading Error:  Assembly  could not be loaded and will be ignored. Could not load file or assembly or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)</title><link>http://blogs.msdn.com/b/brada/archive/2009/12/11/visual-studio-project-sample-loading-error-assembly-could-not-be-loaded-and-will-be-ignored-could-not-load-file-or-assembly-or-one-of-its-dependencies-operation-is-not-supported-exception-from-hresult-0x80131515.aspx</link><pubDate>Sat, 12 Dec 2009 04:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9936006</guid><dc:creator>BradA</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9936006</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2009/12/11/visual-studio-project-sample-loading-error-assembly-could-not-be-loaded-and-will-be-ignored-could-not-load-file-or-assembly-or-one-of-its-dependencies-operation-is-not-supported-exception-from-hresult-0x80131515.aspx#comments</comments><description>&lt;p&gt;Some folks have mentioned to me that they are having trouble getting some of my samples to work.&amp;nbsp; And in fact, just the other day, I ran into a problem getting my own samples to work.&amp;nbsp; It turns out to be a problem with the way windows treats the sample that you down load.&lt;/p&gt;
&lt;p&gt;Specifically, because you downloaded the sample from the internet, windows treats the sample as &amp;ldquo;untrusted&amp;rdquo; content.&amp;nbsp; When you unzip untrusted content you get a directory full of untrusted content.&amp;nbsp; Visual Studio is not so good and running untrusted content.&amp;nbsp; Unfortunately, you get some really bad error messages like the one above.&lt;/p&gt;
&lt;p&gt;Here is the error message from VB&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/VisualStu.ExceptionfromHRESULT0x80131515_11DC2/image_8.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" alt="image" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/VisualStu.ExceptionfromHRESULT0x80131515_11DC2/image_thumb_3.png" width="782" border="0" height="150" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Warning&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; Assembly 'C:\Users\brada\Desktop\MyApp.VB\MyApp.VB.Web\bin\MyApp.VB.Web.dll' could not be loaded and will be ignored.   &lt;br /&gt;Could not load file or assembly 'file:///C:\Users\brada\Desktop\MyApp.VB\MyApp.VB.Web\bin\MyApp.VB.Web.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)&amp;nbsp;&amp;nbsp;&amp;nbsp; MyApp.VB &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And here is the message from C#:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/VisualStu.ExceptionfromHRESULT0x80131515_11DC2/image_12.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" alt="image" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/VisualStu.ExceptionfromHRESULT0x80131515_11DC2/image_thumb_5.png" width="867" border="0" height="159" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Warning&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; Assembly 'C:\Users\brada\Desktop\MyApp.Starter\MyApp.Web\bin\MyApp.Web.dll' could not be loaded and will be ignored.   &lt;br /&gt;Could not load file or assembly 'file:///C:\Users\brada\Desktop\MyApp.Starter\MyApp.Web\bin\MyApp.Web.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)&amp;nbsp;&amp;nbsp;&amp;nbsp; MyApp&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Notice these are warnings, so if you are only looking at errors, you will be even more confused.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is at least a good warning when the project is being loaded.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am not sure why you are giving the option to continue here, because there are very few projects that will just work in the semi-trusted way.&amp;nbsp; If you see this, hit cancel and fix the issue first.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/VisualStu.ExceptionfromHRESULT0x80131515_11DC2/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" alt="image" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/VisualStu.ExceptionfromHRESULT0x80131515_11DC2/image_thumb_2.png" width="751" border="0" height="530" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Luckily fixing this is very easy.&amp;nbsp; Just go back to the ZIP file you downloaded, select properties, then &amp;ldquo;unblock&amp;rdquo; the content.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/VisualStu.ExceptionfromHRESULT0x80131515_11DC2/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" alt="image" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/VisualStu.ExceptionfromHRESULT0x80131515_11DC2/image_thumb.png" width="393" border="0" height="493" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then extract the contents and rerun it.&amp;nbsp; Everything should work fine. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9936006" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category></item><item><title>Bytes by MSDN: Brad Abrams Interview with Billy Hollis: Silverlight 4, RIA Services and VS2010</title><link>http://blogs.msdn.com/b/brada/archive/2009/12/09/bytes-by-msdn-brad-abrams-interview-with-billy-hollis-silverlight-4-ria-services-and-vs2010.aspx</link><pubDate>Wed, 09 Dec 2009 19:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9934439</guid><dc:creator>BradA</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9934439</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2009/12/09/bytes-by-msdn-brad-abrams-interview-with-billy-hollis-silverlight-4-ria-services-and-vs2010.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/bytes.aspx"&gt;Bytes by MSDN&lt;/a&gt; is doing a bunch of really interesting interviews with folks behind the technology.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/ee836085.aspx"&gt;In this interview&lt;/a&gt; I talked to Billy Hollis about Silverlight 4, RIA Services and VS2010.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/ee836085.aspx"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 25px 0px 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="left" src="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/BytesbyMSDNBradAbramsInterviewwithBillyH_144E0/image_3.png" width="244" height="243" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Tune in with Brad Abrams and Billy Hollis as they discuss the latest Silverlight 4 release and the exciting new features and functionalities now available.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Video Downloads&lt;/strong&gt;    &lt;br /&gt;&lt;a href="http://download.microsoft.com/download/0/C/C/0CCD857D-1028-4215-959E-92ABFCC523D0/BytesByMSDN-winvideo-BradAbrams.zip"&gt;WMV (Zip)&lt;/a&gt; | &lt;a href="http://download.microsoft.com/download/0/C/C/0CCD857D-1028-4215-959E-92ABFCC523D0/BytesByMSDN-winvideo-BradAbrams.wmv"&gt;WMV&lt;/a&gt; | &lt;a href="http://download.microsoft.com/download/0/C/C/0CCD857D-1028-4215-959E-92ABFCC523D0/BytesByMSDN-ipod-BradAbrams(2).mp4"&gt;iPod&lt;/a&gt; | &lt;a href="http://download.microsoft.com/download/0/C/C/0CCD857D-1028-4215-959E-92ABFCC523D0/BytesByMSDN-mp4video-BradAbrams(4).m4v"&gt;MP4&lt;/a&gt; | &lt;a href="http://download.microsoft.com/download/0/C/C/0CCD857D-1028-4215-959E-92ABFCC523D0/BytesByMSDN-3gp-BradAbrams(1).3gp"&gt;3GP&lt;/a&gt; | &lt;a href="http://download.microsoft.com/download/0/C/C/0CCD857D-1028-4215-959E-92ABFCC523D0/BytesByMSDN-zune-BradAbrams(3).wmv"&gt;Zune&lt;/a&gt; | &lt;a href="http://download.microsoft.com/download/0/C/C/0CCD857D-1028-4215-959E-92ABFCC523D0/BytesByMSDN-psp-BradAbrams.zip"&gt;PSP&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Audio Downloads&lt;/strong&gt;    &lt;br /&gt;&lt;a href="http://download.microsoft.com/download/0/C/C/0CCD857D-1028-4215-959E-92ABFCC523D0/BytesByMSDN-aac-BradAbrams(9).aac"&gt;AAC&lt;/a&gt; | &lt;a href="http://download.microsoft.com/download/0/C/C/0CCD857D-1028-4215-959E-92ABFCC523D0/BytesByMSDN-wma-BradAbrams(5).wma"&gt;WMA&lt;/a&gt; | &lt;a href="http://download.microsoft.com/download/0/C/C/0CCD857D-1028-4215-959E-92ABFCC523D0/BytesByMSDN-mp2-BradAbrams(6).mp2"&gt;MP2&lt;/a&gt; | &lt;a href="http://download.microsoft.com/download/0/C/C/0CCD857D-1028-4215-959E-92ABFCC523D0/BytesByMSDN-mp3-BradAbrams(7).mp3"&gt;MP3&lt;/a&gt; | &lt;a href="http://download.microsoft.com/download/0/C/C/0CCD857D-1028-4215-959E-92ABFCC523D0/BytesByMSDN-mp4audio-BradAbrams(8).m4a"&gt;MP4&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9934439" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category></item><item><title>Field Level Access with RIA Services</title><link>http://blogs.msdn.com/b/brada/archive/2009/12/08/field-level-access-with-ria-services.aspx</link><pubDate>Tue, 08 Dec 2009 18:56:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9934210</guid><dc:creator>BradA</dc:creator><slash:comments>15</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9934210</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2009/12/08/field-level-access-with-ria-services.aspx#comments</comments><description>&lt;p&gt;There are lots of reason you may need to customize the access to given fields within an entity.&amp;#160; For example, &lt;a href="http://www.hipaa.org/"&gt;HIPPA&lt;/a&gt; compliance requires that some data not be exposed to only employees with a need to know.&amp;#160;&amp;#160; It is often not sufficient to just NOT show the data in the Silverlight client, you need to not even send it over the wire.&amp;#160; &lt;/p&gt;  &lt;p&gt;This example works with &lt;a href="http://silverlight.net/getstarted/silverlight-4-beta/"&gt;Silverlight 4\RIA Services Beta&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx"&gt;Visual Studio 2010 Beta2&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I built a very simple RIA Services + Silverlight 4 example to show how this could be done.&amp;#160;&amp;#160; First, let’s run the app, then we can look at how we built it. &lt;/p&gt;  &lt;p&gt;The first thing to notice is when we run it, no users are logged in, so we get no access to the data at all.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/FieldLevelAccesswithRIAServices_97B4/image3.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/FieldLevelAccesswithRIAServices_97B4/image3_thumb.png" width="396" height="272" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;First, let’s log in as a Rocky, who is a jr. employee at our company.&amp;#160; He should NOT have access to the social security numbers of employees, but the other information is good for him to be able to access.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/FieldLevelAccesswithRIAServices_97B4/image6.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/FieldLevelAccesswithRIAServices_97B4/image6_thumb.png" width="675" height="363" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As you can see, no SSNs are displayed.&lt;/p&gt;  &lt;p&gt;Now, let’s log in as Billy, who is our HR Manager…&amp;#160; As you can see, Billy has a need to know what the SSN is for most employees, so those are visible to him.&amp;#160; But notice, even he can not see VP level personal information.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/FieldLevelAccesswithRIAServices_97B4/image9.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://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/FieldLevelAccesswithRIAServices_97B4/image9_thumb.png" width="687" height="340" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;OK, now let’s look at how we implemented this.&amp;#160;&amp;#160; Really the key code is the domain service on which runs on the server:&lt;/p&gt;  &lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  1:     [RequiresAuthentication]
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  2:     [EnableClientAccess()]
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  3:     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; EmployeesDomainService : LinqToEntitiesDomainService&amp;lt;NORTHWNDEntities&amp;gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  4:     {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  5: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  6:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IQueryable&amp;lt;Employee&amp;gt; GetEmployees()
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  7:         {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  8:             &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (var e &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ObjectContext.Employees)
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  9:             {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 10:                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ServiceContext.User.IsInRole(&amp;quot;&lt;span style="color: #8b0000"&gt;HRManagers&lt;/span&gt;&amp;quot;))
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 11:                 {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 12:                     e.SSN = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 13:                 }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 14:                 &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (e.Title.Contains(&amp;quot;&lt;span style="color: #8b0000"&gt;Vice President&lt;/span&gt;&amp;quot;))
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 15:                 {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 16:                     e.SSN = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 17:                 }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 18:             }
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 19:             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ObjectContext.Employees;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 20:         }
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 21: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 22: &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;In line 1, we mark this services are only accessible to users that are logged in.&lt;/p&gt;

&lt;p&gt;In line 10, we are making sure that only the user making the request is in the role that enables them to have access to the SSN, if not, we null it out.&lt;/p&gt;

&lt;p&gt;In line 14, we have a (lame) example to show accessing data on the entity to decide if the user should have access.&amp;#160; In this case, even the HRManager can’t access the VP’s SSN.&amp;#160; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Some notes on running the app:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://brad_abrams.members.winisp.net/Projects/PDC2009/FieldCustomAuth.zip"&gt;Download the source code&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;Billy and Rocky’s passwords are “password1!” &lt;/li&gt;

  &lt;li&gt;Be sure the refresh the page after logging in or out&lt;/li&gt;

  &lt;li&gt;You can customize the roles by using the IIS Admin tool or the ASP.NET configuration properties on the Web solution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9934210" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category></item><item><title>PDC09 Talk: Building Amazing Business Applications with Silverlight 4, RIA Services and Visual Studio 2010 – Now in Visual Basic!!</title><link>http://blogs.msdn.com/b/brada/archive/2009/11/27/pdc09-talk-building-amazing-business-applications-with-silverlight-4-ria-services-and-visual-studio-2010-now-in-visual-basic.aspx</link><pubDate>Sat, 28 Nov 2009 06:13:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9929580</guid><dc:creator>BradA</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9929580</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2009/11/27/pdc09-talk-building-amazing-business-applications-with-silverlight-4-ria-services-and-visual-studio-2010-now-in-visual-basic.aspx#comments</comments><description>&lt;p&gt;I had a great time at &lt;a href="http://microsoftpdc.com/Sessions/CL21"&gt;my talk&amp;#160; PDC2009&lt;/a&gt; talk, but i was disappointed that I could not demo in both C# and VB… So here is the next best thing: A full play-by-play of the demo, but all in VB!&amp;#160;&amp;#160; Enjoy.&lt;/p&gt;  &lt;p&gt;What you need to get started:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx"&gt;Visual Studio 2010 Beta2&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://silverlight.net/"&gt;Silverlight 4 Beta&lt;/a&gt; (now includes &lt;a href="http://silverlight.net/riaservices/"&gt;RIA Services&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;&lt;a href="http://brad_abrams.members.winisp.net/Projects/PDC2009/MyApp.VB.zip"&gt;Completed Solution (in VB) &lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Check out &lt;a href="http://brad_abrams.members.winisp.net/Projects/PDC2009/RIAServicesOverviewPDC2009.pptx"&gt;the slides and video &lt;/a&gt;&amp;#160; from the talk&lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Starting Off&lt;/h3&gt;  &lt;p&gt;I am starting off with the new Business Application Template that gets installed with RIA Services.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_10E81/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://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_10E81/image_thumb.png" width="368" height="255" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This new template includes:&lt;/p&gt;  &lt;ul&gt;   &lt;ul&gt;     &lt;li&gt;Pattern for page navigation &lt;/li&gt;      &lt;li&gt;Log\Logout and new user registration support &lt;/li&gt;      &lt;li&gt;Localizable &lt;/li&gt;      &lt;li&gt;User settings &lt;/li&gt;      &lt;li&gt;Shared Code &lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;For this demo, I am going to used a customized version of the template..&lt;/p&gt;  &lt;p&gt;After you create the project, you see we have a simple solution setup that follows the “RIA Application” pattern.&amp;#160; That is one application that happens to span a client (Silverlight) and server (asp.net) tiers.&amp;#160; These two are tied such that any change in the Silverlight client is reflected in the server project (a new XAP is placed in client bin) and appropriate changes in the server result in new functionality being exposed to the Silverlight client. To parts of the same application. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_10E81/image_3.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://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_10E81/image_thumb_3.png" width="131" height="240" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h5&gt;Exposing the Data&lt;/h5&gt;  &lt;p&gt;I started out with an Entity Framework model.&amp;#160; RIA Services supports any DAL including Linq2Sql, NHibernate as well as DataSets and DataReader\Writer.&amp;#160;&amp;#160; But EF has made some great improvements in .NET 4, so I felt it was a good place to start.&amp;#160; &lt;/p&gt;  &lt;p&gt;So here is the EF model I created.&amp;#160; Basically we have a set of restaurants, each of which has a set of plates they serve.&amp;#160; A very simple model designed many to show off the concepts.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_4.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_4.png" width="281" height="292" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then we need to place to write our business logic that controls how the Silverlight client can interact with this data.&amp;#160;&amp;#160;&amp;#160; To do this create a new DomainService.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_10E81/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="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_10E81/image_thumb_4.png" width="361" height="250" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Then select the tables you want to expose:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_6.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_6.png" width="196" height="240" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now, let’s look at our code for the DomainService…&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:9175ffe7-1d0c-42bb-962f-369ef061822c" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Imports&lt;/span&gt; MyApp.VB&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;Imports&lt;/span&gt; System&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Imports&lt;/span&gt; System.Data&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;Imports&lt;/span&gt; System.Linq&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Imports&lt;/span&gt; System.Web.DomainServices&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;Imports&lt;/span&gt; System.Web.Ria&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Imports&lt;/span&gt; System.Web.DomainServices.Providers&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;EnableClientAccess&lt;/span&gt;()&amp;gt; _&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;PlateViewDomainService&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Inherits&lt;/span&gt; &lt;span style="color:#2b91af"&gt;LinqToEntitiesDomainService&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;Of&lt;/span&gt; &lt;span style="color:#2b91af"&gt;DishViewEntities&lt;/span&gt;)&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Function&lt;/span&gt; GetRestaurants() &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#2b91af"&gt;IQueryable&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;Of&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Restaurant&lt;/span&gt;)&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Return&lt;/span&gt; &lt;span style="color:#0000ff"&gt;From&lt;/span&gt; r &lt;span style="color:#0000ff"&gt;In&lt;/span&gt; ObjectContext.Restaurants&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Where&lt;/span&gt; r.City &amp;lt;&amp;gt; &lt;span style="color:#a31515"&gt;"Raligh"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Order&lt;/span&gt; &lt;span style="color:#0000ff"&gt;By&lt;/span&gt; r.ID&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Function&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Class&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;In line 10 – we are enabling this service to be accessed from clients.. without this, the DomainService is only accessible from on the machine (for example for an ASP.NET hosted on the same machine). &lt;/p&gt;  &lt;p&gt;In line 11: we are defining the DomainService – you should think of a DomainService as just a special kind of WCF Service.. one that is higher level and has all the right defaults set so that there is zero configuration needed.&amp;#160;&amp;#160; Of course the good news is that if you *need* to you can get access to the full richness of WCF and configure the services however you’d like. &lt;/p&gt;  &lt;p&gt;In line 12: you see we are using the LinqToEntitiesDomainService.&amp;#160; RIA Services supports any DAL including LinqToSql or NHibernate.&amp;#160; Or what I think is very common is just POCO.. that is deriving from DomainService directly.&amp;#160; See examples of these here…&lt;/p&gt;  &lt;p&gt;In line 14:&amp;#160; We are defining a Query method.. this is based on LINQ support added in VS2008.&amp;#160; Here we define the business logic involved in return data to the client.&amp;#160; When the framework calls this method, it will compose a LINQ query including paging, sorting, filtering from the client then execute it directly against the EF model which translate it into optimized TSQL code.&amp;#160; So no big chunks of unused data are brought to the mid-tier or the client.&amp;#160; &lt;/p&gt;  &lt;h3&gt;Consuming the data on the client&lt;/h3&gt;  &lt;p&gt;Now let’s switch over the client project and look at how we consume this.&amp;#160; &lt;/p&gt;  &lt;p&gt;in Views\Home.xaml we have a very simple page with just a DataGrid defined.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:51f75bb6-8b22-4930-b796-f29522947075" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataGrid&lt;/span&gt;&lt;span style="color:#ff0000"&gt; AutoGenerateColumns&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="True"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="dataGrid1"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Height&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="456"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Width&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="618" /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;now let’s flip over to codebhind.. &lt;/p&gt;  &lt;p&gt;Notice we have a MyApp.Web namespace available on the client. Notice that is the same namespace we defined our DomainService in..&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_10E81/image_5.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://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_10E81/image_thumb_5.png" width="473" height="203" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So, let’s create a local context for accessing our DomainService.&amp;#160; First thing you will notice is that VS2010 Intellisense makes it very easy to find what we want.. it now matches on any part of the class name..&amp;#160; So just typing “domainc” narrows our options to the right one..&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_10E81/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="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_10E81/image_thumb_6.png" width="453" height="132" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:907892a2-2b0b-4e40-849d-1b6862126705" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Dim&lt;/span&gt; context = &lt;span style="color:#0000ff"&gt;New&lt;/span&gt; &lt;span style="color:#2b91af"&gt;PlateViewDomainContext&lt;/span&gt;()&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;dataGrid1.ItemsSource = context.Restaurants&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;context.Load(context.GetRestaurantsQuery())&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;In line 2, notice there is a property on context called Restaurants.&amp;#160; How did we get that there?&amp;#160; Well, there is a query method defined on the DomainService returning a type of type Restaurant.&amp;#160; This gives us a very clean way to do databinding.&amp;#160; Notice this call is actually happening async, but we don’t have to deal with any of that complexity.&amp;#160; No event handlers, callbacks, etc.&amp;#160; &lt;/p&gt;  &lt;p&gt;In line 4, while the whole point of RIA Services is to make n-tier development as easy as two-tier development that most of us are used to, we want to make sure the applications that are created are well behaved.&amp;#160;&amp;#160; So part of this is we want to be explicit when a network call is being made.. this is not transparent remoting.&amp;#160; Network calls must be explicit.&amp;#160;&amp;#160;&amp;#160; In this line we are mentioning which query method to use as you might define more than one for the same type with different logic.&amp;#160; &lt;/p&gt;  &lt;p&gt;Now we run it.. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_9.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_9.png" width="381" height="267" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This is very cool and simple.&amp;#160; But in a real world case, i am guessing you have more than 20 records… sometimes you might have 100s, or thousands or more.&amp;#160; You can’t just send all those back to the client.&amp;#160; Let’s see how you can implement paging and look at some of the new design time features in VS2010 as well.&amp;#160; &lt;/p&gt;  &lt;h5&gt;RIA Services support in Visual Studio 2010&lt;/h5&gt;  &lt;p&gt;Let’s delete that code we just wrote and flip over to the design surface and delete that datagrid.&amp;#160; &lt;/p&gt;  &lt;p&gt;Drop down the DataSources window (you may need to look under the Data menu for “Show Data Sources”&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_10.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_10.png" width="240" height="201" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you are familiar with WinForms or WPF development, this will look at least somewhat familiar to you.&amp;#160;&amp;#160; Notice our DishViewDomainContext is listed there with a table called Restaurant.&amp;#160; Notice this is exactly what we saw in the code above because this window is driven off that same DomainContext.&amp;#160; &lt;/p&gt;  &lt;p&gt;Dropping down the options on Restaurant, we see we have a number of options for different controls that can be used to view this data… of course this is extensible and we expect 3rd party as well as your custom controls to work here.&amp;#160;&amp;#160;&amp;#160; Next see the query method here that is checked.&amp;#160; That lists all the available options for query methods that return Restaurant.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_11.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_11.png" width="240" height="235" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now if we expand the view on Restaurant, we see all the data member we have exposed.&amp;#160; This view gives us a chance to change how each data member will be rendered.&amp;#160; Notice I have turned off the ID and changed the Imagepath to an Image control.&amp;#160; Again this is an extensible and we expect 3rd party controls to plug in here nicely.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_12.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_12.png" width="170" height="240" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now, drag and drop Restaurant onto the form and we get some UI&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_13.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_13.png" width="458" height="252" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And for you Xaml heads that want to know what really happens… Two things.&amp;#160; First if the DomainDataSource is not already created, one is created for you. &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:aae94855-1f75-43e0-9fc6-425770ec9ee7" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;riaControls&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DomainDataSource&lt;/span&gt;&lt;span style="color:#ff0000"&gt; AutoLoad&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="True"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Height&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="0"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="RestaurantDomainDataSource"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; QueryName&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="GetRestaurantsQuery"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Width&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="0"&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;riaControls&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DomainDataSource.DomainContext&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;my&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;PlateViewDomainContext&lt;/span&gt;&lt;span style="color:#0000ff"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;riaControls&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DomainDataSource.DomainContext&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;riaControls&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DomainDataSource&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Finally, the DataGrid is created with a set of columns.&amp;#160; &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:81b9bf5c-4749-4b5c-a15a-e0ec3c24fb76" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataGrid&lt;/span&gt;&lt;span style="color:#ff0000"&gt; AutoGenerateColumns&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="False"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Height&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="200"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; HorizontalAlignment&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="Left"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; ItemsSource&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; ElementName&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=RestaurantDomainDataSource,&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Path&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=Data}"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Margin&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="190,110,0,0"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="RestaurantDataGrid"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; RowDetailsVisibilityMode&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="VisibleWhenSelected"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; VerticalAlignment&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="Top"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Width&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="400"&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataGrid.Columns&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataGridTextColumn&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="AddressColumn"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Binding&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Path&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=Address}"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Header&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="Address"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Width&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="SizeToHeader" /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Then setup a grid cell by click 4/5ths of the way down on the left grid adorner.&amp;#160; Then select the grid, right click, select reset layout all.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_14.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_14.png" width="403" height="240" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;.. add poof! VS automatically lays out the DataGrid to fill the cell just right.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_15.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_15.png" width="240" height="172" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now, personally, I always like the Name column to come first.&amp;#160; Let’s go fix that by using the DataGrid column designer.&amp;#160; Right click on the DataGrid select properties then click on the Columns property..&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_16.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_16.png" width="240" height="144" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In this designer you can control the order of columns and the layout, etc.&amp;#160;&amp;#160; I moved the image and name fields to the top.&lt;/p&gt;  &lt;p&gt;Now, let’s add a DataPager such that we only download a manageable number of records at a time. From the toolbox, simply drag the datapager out.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_17.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_17.png" width="240" height="155" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;We use our same trick to have VS auto layout the control&amp;#160; Right click on it and select Reset Layout\All.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_18.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_18.png" width="240" height="102" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;That is cool, but there is a big&amp;#160; gap between the DataGrid and the DataPager.. I really want them to be right.&amp;#160; This is easy to fix.&amp;#160; Right click on the grid adorner and select “Auto”.. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_19.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_19.png" width="414" height="81" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Perfect!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_20.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_20.png" width="342" height="104" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now, we just need to wire this up to the same DataSource our DataGrid is using “connect-the-dots” databinding.&amp;#160; Simply drag the Restaurant from the DataSources window on top of the DataGrid.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_21.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_21.png" width="240" height="180" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;For you Xaml heads, you’ll be interested in the Xaml this creates..&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:cfff4ac3-601d-44b1-b306-91cb3d7efcb7" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataPager&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Grid.Row&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="1"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="DataPager1"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; PageSize&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="10"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Source&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; ElementName&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=RestaurantDomainDataSource,&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Path&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=Data}" /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Notice, we don’t need to create a new DomainDataSource here… we will use the one that is already on the page. &lt;/p&gt;  &lt;p&gt;Now, we are doing an async call.. so let’s drag a&amp;#160; BusyIndicator from the new Silverlight 4 Toolkit.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_22.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_22.png" width="240" height="171" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;We need to write up the IsBusy to the restaurantDomainDataSource.DomainContext.IsLoading… Luckily there is some nice databinding&amp;#160; helper in VS2010.&amp;#160; Select properties, then IsBusy, then DataBinding. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_23.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_23.png" width="374" height="234" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Again, for you Xaml heads, the Xaml that gets generated is pretty much what you’d expect.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:61154244-76ee-4612-a182-130a8d2e7075" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;controlsToolkit&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;BusyIndicator&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Height&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="83"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; HorizontalAlignment&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="Left"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Margin&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="274,137,0,0"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="BusyIndicator1"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; VerticalAlignment&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="Top"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Width&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="188"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; IsBusy&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; ElementName&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=RestaurantDomainDataSource,&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Path&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=DomainContext.IsLoading}" /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Loading…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_24.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_24.png" width="240" height="168" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;and once it is loaded…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_25.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_25.png" width="240" height="168" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Very cool…&amp;#160; that was a very easy was to get your data.&amp;#160;&amp;#160;&amp;#160; Page through it and notice that with each page we are going back all the way to the data tier to load more data.&amp;#160; So you could just as easily do this on a dataset of million+ records.&amp;#160;&amp;#160;&amp;#160; But what is more, is that sorting works as well and just as you’d expect.&amp;#160; It doesn’t sort just the local data, it sorts the full dataset and it does it all way back onto the data tier and just pulls forward the page of data you need to display.&lt;/p&gt;  &lt;p&gt;But our pictures are not showing up… let’s look at how we wire up the pictures.&amp;#160; The reason they are not showing up is that our database returns just the simple name of the image, not the full path.&amp;#160; This allows us to be flexible about the where the images are stored.&amp;#160;&amp;#160; The standard way to handle this is to write a &lt;a href="http://timheuer.com/blog/archive/2008/07/30/format-data-in-silverlight-databinding-valueconverter.aspx"&gt;value converter&lt;/a&gt;.&amp;#160;&amp;#160;&amp;#160;&amp;#160; Here is a simple example:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:05602e5f-9b51-497a-b989-7eb46fbcf9fe" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ImagePathConverter&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Implements&lt;/span&gt; &lt;span style="color:#2b91af"&gt;IValueConverter&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Function&lt;/span&gt; Convert(&lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; value &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Object&lt;/span&gt;, &lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; targetType &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Type&lt;/span&gt;, &lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; parameter &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Object&lt;/span&gt;, &lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; culture &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; Globalization.&lt;span style="color:#2b91af"&gt;CultureInfo&lt;/span&gt;) &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Object&lt;/span&gt; _&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Implements&lt;/span&gt; &lt;span style="color:#2b91af"&gt;IValueConverter&lt;/span&gt;.Convert&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Dim&lt;/span&gt; path &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;String&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;path = value.ToString()&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;path = path.Replace(&lt;span style="color:#a31515"&gt;":"&lt;/span&gt;, &lt;span style="color:#a31515"&gt;""&lt;/span&gt;)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;path = path.Replace(&lt;span style="color:#a31515"&gt;"/"&lt;/span&gt;, &lt;span style="color:#a31515"&gt;""&lt;/span&gt;)&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;path = path.Replace(&lt;span style="color:#a31515"&gt;"&amp;#92;&amp;#92;"&lt;/span&gt;, &lt;span style="color:#a31515"&gt;""&lt;/span&gt;)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;If&lt;/span&gt; path.Length &amp;gt; &lt;span style="color:#a52a2a"&gt;100&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Then&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;path = path.Substring(&lt;span style="color:#a52a2a"&gt;0&lt;/span&gt;, &lt;span style="color:#a52a2a"&gt;100&lt;/span&gt;)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;If&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Return&lt;/span&gt; &lt;span style="color:#a31515"&gt;"http://hanselman.com/abrams/Images/Plates/"&lt;/span&gt; + path&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Function&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now, let’s look at how we wire this converter to the UI.&amp;#160;&amp;#160; First, let’s use the Document Outline to drill through the visual tree to find the Image control.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_26.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_26.png" width="152" height="368" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then we select the properties on the image and wire up this converter.&amp;#160; If you have done this in Xaml directly before, you know it is hard to get right.&amp;#160; VS2010 makes this very easy!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_27.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_27.png" width="240" height="201" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Oh, and for you Xaml heads… here is what VS created..&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:ca9a86d5-7ca2-42ba-badb-6e990bbb7b84" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;navigation&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;Page.Resources&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;my&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;ImagePathConverter&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Key&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="ImagePathConverter1" /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;navigation&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;Page.Resources&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;and&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:a7ffb2aa-07ec-42cb-9746-592efe75a813" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataGridTemplateColumn&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="ImagePathColumn"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Header&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="Image Path"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Width&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="SizeToHeader"&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataGridTemplateColumn.CellTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Image&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Source&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Path&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=ImagePath,&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Converter&lt;/span&gt;&lt;span style="color:#0000ff"&gt;={&lt;/span&gt;&lt;span style="color:#a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="color:#ff0000"&gt; ImagePathConverter1&lt;/span&gt;&lt;span style="color:#0000ff"&gt;}}" /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataGridTemplateColumn.CellTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataGridTemplateColumn&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;h3&gt;Silverlight Navigation&lt;/h3&gt;  &lt;p&gt;Now let’s look at how we drill down and get the details associated with each of these records.&amp;#160; I want to show this is a “web” way… So I’ll show how to create a deep link to a new page that will list just the plates for the restaurant you select.&amp;#160; &lt;/p&gt;  &lt;p&gt;First we add a bit of Xaml to add the link to the datagrid..&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:47d4f28f-ff27-4d55-9b0d-1a2462ec9b43" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataGrid.Columns&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataGridTemplateColumn&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Header&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=""&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataGridTemplateColumn.CellTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Button&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Content&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="+"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Style&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="{&lt;/span&gt;&lt;span style="color:#a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="color:#ff0000"&gt; DetailsButtonStyle&lt;/span&gt;&lt;span style="color:#0000ff"&gt;}"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Click&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="Button_Click"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Button&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataGridTemplateColumn.CellTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataGridTemplateColumn&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;And to implement the button click handler…&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:47e35b6d-5ca1-421d-9135-ea21fd76b038" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Sub&lt;/span&gt; Button_Click(&lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; sender &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; System.&lt;span style="color:#2b91af"&gt;Object&lt;/span&gt;, &lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; e &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; System.Windows.&lt;span style="color:#2b91af"&gt;RoutedEventArgs&lt;/span&gt;)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Dim&lt;/span&gt; res &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Restaurant&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;res = RestaurantDomainDataSource.DataView.CurrentItem&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NavigationService.Navigate(&lt;span style="color:#0000ff"&gt;New&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Uri&lt;/span&gt;(&lt;span style="color:#a31515"&gt;"/Plates?restaurantId="&lt;/span&gt; _&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp; res.ID, &lt;span style="color:#2b91af"&gt;UriKind&lt;/span&gt;.Relative))&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Sub&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Here we are getting the currently selected Restaurant, then we cons up a new URL to the page “Plates”.&amp;#160; We pass a query string parameter of restaurantId… &lt;/p&gt;  &lt;p&gt;Now, let’s build out the Plates page that will the list of Plates for this restaurant.&amp;#160; First let’s great a a Plates page.&amp;#160; Let’s add a new Plates under the Views directory.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_28.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_28.png" width="240" height="171" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now we need to define a query to return the Plates.&amp;#160; Notice that only the data you select is exposed.&amp;#160; So we get to go back to the server, to our DishViewDomainService and add a new query method.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:abb275a1-c460-4c3a-8ee3-a36b294ba725" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Function&lt;/span&gt; GetPlates() &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#2b91af"&gt;IQueryable&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;Of&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Plate&lt;/span&gt;)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Return&lt;/span&gt; &lt;span style="color:#0000ff"&gt;From&lt;/span&gt; r &lt;span style="color:#0000ff"&gt;In&lt;/span&gt; ObjectContext.Plates&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Order&lt;/span&gt; &lt;span style="color:#0000ff"&gt;By&lt;/span&gt; r.ID&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Function&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Now we go back to the client, and see your DataSources window now offers a new datasource: Plates. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_29.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_29.png" width="173" height="282" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now, just as we saw above, I will drag and drop that data source onto the form and i get a nice datagrid alreayd wired up to a DomainDataSource.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_30.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_30.png" width="240" height="170" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then, with a little formatting exactly as we saw above, we end up with…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_31.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_31.png" width="240" height="120" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And when we run it… First, you see the link we added to the list of Restaurants.. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_32.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_32.png" width="240" height="168" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Clicking on anyone of them navigates us to our Plates page we just built.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_33.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_33.png" width="240" height="108" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;Customized Data Access&lt;/h3&gt;  &lt;p&gt;This is cool, but notice we are actually returning *all* the plates, not just the plates from the restaurant selected.&amp;#160;&amp;#160;&amp;#160; To address this first we need modify our GetPlates() query method to take in a resource id.&amp;#160; &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:c283982c-8af1-41f7-9fd9-edb2b5493694" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Function&lt;/span&gt; GetPlates(&lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; resId &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Integer&lt;/span&gt;) &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#2b91af"&gt;IQueryable&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;Of&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Plate&lt;/span&gt;)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Return&lt;/span&gt; &lt;span style="color:#0000ff"&gt;From&lt;/span&gt; r &lt;span style="color:#0000ff"&gt;In&lt;/span&gt; ObjectContext.Plates&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Where&lt;/span&gt; r.RestaurantID = resId&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Order&lt;/span&gt; &lt;span style="color:#0000ff"&gt;By&lt;/span&gt; r.ID&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Function&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now, back on the client, we just need to pass the query string param…&amp;#160; &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:1569a8a1-389a-44b4-a70a-cf7bf8ab9e93" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Protected&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Overrides&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Sub&lt;/span&gt; OnNavigatedTo(&lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; e &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; System.Windows.Navigation.&lt;span style="color:#2b91af"&gt;NavigationEventArgs&lt;/span&gt;)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Dim&lt;/span&gt; param = &lt;span style="color:#0000ff"&gt;New&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Parameter&lt;/span&gt;()&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;param.ParameterName = &lt;span style="color:#a31515"&gt;"resId"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;param.Value = NavigationContext.QueryString(&lt;span style="color:#a31515"&gt;"restaurantId"&lt;/span&gt;)&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PlateDomainDataSource.QueryParameters.Add(param)&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Sub&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Now, we run it and we get the just the plates for the restaurant we selected.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_34.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_34.png" width="360" height="162" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;what’s more is we now have a deep link such that it works when I email, IM or tweet this link to my buddy who happens to run a different browser ;-)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_35.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_35.png" width="353" height="150" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Ok… now for a details view…&amp;#160; Let’s do a bit more layout in the Plates.xaml.&amp;#160;&amp;#160; First, let’s split the form in half vertically to give us some cells to work in.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_36.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_36.png" width="240" height="159" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In the bottom left we will put the details view to allow us to edit this plate data.&amp;#160; Let’s go back to the DataSources window and change the UI type to Details.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_37.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_37.png" width="160" height="240" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Dragging that Details onto the form… we get some great UI generation that we can go in and customize. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_38.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_38.png" width="240" height="171" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In particular, let’s format that Price textbox as a “currency”… using the new String Formatting support in Silverlight 4.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_39.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_39.png" width="402" height="178" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And again, for you Xaml heads… this created:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Text=&amp;quot;{Binding Path=Price, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true, StringFormat=\{0:c\}}&amp;quot; &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Now, let’s add an image to the other side.&amp;#160; Simply drop an Image control on the form and select Reset Layout\All&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_40.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_40.png" width="240" height="183" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now we can easily change the image to be “Uniform”&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_41.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_41.png" width="404" height="249" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now we need to write up the binding here so that as selection changes, this image is update.&amp;#160; Luckily, that is very easy to do.&amp;#160;&amp;#160;&amp;#160; Simply drag and drop from the Data Sources window…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_42.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_42.png" width="359" height="290" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then we need to wire up our converter just as we saw before..&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_43.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_43.png" width="240" height="171" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Run it…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_44.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_44.png" width="240" height="173" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;That looks great!&amp;#160; &lt;/p&gt;  &lt;p&gt;But when we try edit something, we get this error..&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_45.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_45.png" width="240" height="126" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;Editing Data&lt;/h3&gt;  &lt;p&gt;Ahh, that is a good point, we need to go back and explicitly define a Update method to our DomainService on the server. &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:ed197d74-4d93-4477-b8f5-e3757d4f3ece" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Sub&lt;/span&gt; UpdatePlate(&lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; currentPlate &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Plate&lt;/span&gt;)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;currentPlate.NumberUpdates += &lt;span style="color:#a52a2a"&gt;1&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Dim&lt;/span&gt; orginal = ChangeSet.GetOriginal(currentPlate)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;If&lt;/span&gt; orginal.Price &amp;lt;&amp;gt; currentPlate.Price &lt;span style="color:#0000ff"&gt;Then&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#008000"&gt;' add 1 dollar fee for changing price &lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;currentPlate.Price += &lt;span style="color:#a52a2a"&gt;1&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;If&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ObjectContext() _&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.AttachAsModified(currentPlate, orginal)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Sub&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;In line 2, notice we take the NumberUpdates and increment by one.&amp;#160; it is nice that we send the entry entity back and forth, so we can do entity level operations very easily.&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;Next in line 3, we pull out the original value.. .this is the plate instance as the client saw it &lt;em&gt;before&lt;/em&gt; it was updated.&amp;#160; &lt;/p&gt;  &lt;p&gt;In line 4-7, we first check to see if the price has changed, if it has, we add a fee of one dollar for a price change.&amp;#160; &lt;/p&gt;  &lt;p&gt;Finally&amp;#160; in line 8-9, we submit this change to the database.&amp;#160; &lt;/p&gt;  &lt;p&gt;Now we just need to drop a button on the form.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_46.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_46.png" width="240" height="206" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then write some codebehind..&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:a2cbcb96-6eae-4f98-88fc-1c3847cae724" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Sub&lt;/span&gt; Button1_Click(&lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; sender &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; System.&lt;span style="color:#2b91af"&gt;Object&lt;/span&gt;, &lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; e &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; System.Windows.&lt;span style="color:#2b91af"&gt;RoutedEventArgs&lt;/span&gt;) &lt;span style="color:#0000ff"&gt;Handles&lt;/span&gt; Button1.Click&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PlateDomainDataSource.SubmitChanges()&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Sub&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;What this is going to do is find all the entities that are dirty (that have changes) and package them up and send them to the server.&amp;#160; &lt;/p&gt;  &lt;p&gt;Now notice if you make a change price to the data and hit submit the NumberUpdates goes up by one and the the price has the one dollar fee added. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_47.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_47.png" width="240" height="191" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then submit..&amp;#160; NumberUpdates is now 63 and the price is $73.84.. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_48.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_48.png" width="240" height="198" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then if you set a breakpoint on the server, change two or three records on the client.&amp;#160; Notice the breakpoint gets hit for each change.&amp;#160;&amp;#160;&amp;#160; We are batching these changes to make an efficient communication pattern.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_49.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_49.png" width="387" height="276" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Great.. now let’s look at data validation.&lt;/p&gt;  &lt;p&gt;We get some validation for free.&amp;#160; for example Calorie Count is a int, if we put a string in, we get a stock error message.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_50.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_50.png" width="240" height="168" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If we want to customize this a bit more, we can go back to the server and specify our validation there.&amp;#160; It is important to do it on the server because you want validation to happen&amp;#160; on the client for good UI, but on the server for the tightest security.&amp;#160; Following the DRY principle (Don’t Repeat Yourself) we have a single place to put this validation data that works on the client and the server. &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:56fe31cc-931a-4448-8492-debd2340a4e8" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Required&lt;/span&gt;(ErrorMessage:=&lt;span style="color:#a31515"&gt;"Please provide a name"&lt;/span&gt;)&amp;gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; Name &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;String&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; NumberUpdates &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Nullable&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;Of&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Integer&lt;/span&gt;)&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Range&lt;/span&gt;(&lt;span style="color:#a52a2a"&gt;0&lt;/span&gt;, &lt;span style="color:#a52a2a"&gt;99&lt;/span&gt;)&amp;gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; Price &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Nullable&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;Of&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Decimal&lt;/span&gt;)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;RegularExpression&lt;/span&gt;(&lt;span style="color:#a31515"&gt;"^http&amp;#92;://[a-zA-Z0-9&amp;#92;-&amp;#92;.]+&amp;#92;.[a-zA-Z]{2,3}(/&amp;#92;S*)?$"&lt;/span&gt;,&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ErrorMessage:=&lt;span style="color:#a31515"&gt;"Please use standard Url format"&lt;/span&gt;)&amp;gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; Uri &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;String&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The data validation attributes are a core part of .NET with ASP.NET Dynamic Data and ASP.NET MVC using the exact same model.&lt;/p&gt;  &lt;p&gt;But what if they are not expressive enough for you?&amp;#160; For example, say I have a custom validation I have for making sure the description is valid..&amp;#160;&amp;#160; To do that, I can write some .NET code that executes on the server AND the client.&amp;#160; Let’s see how to do that.&amp;#160; First I create a class on the server..&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_51.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_51.png" width="310" height="221" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Notice the name here PlateValidationRules.shared.cs…. the “.shared” part is important… it is what tells us that this code is meant to be on the client and the server. &lt;/p&gt;  &lt;p&gt;In this case, i am saying a valid description is one that has 5 more more words&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:33ad119f-66cd-4d58-bd3e-74339f129060" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;PlateValidationRules&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Shared&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Function&lt;/span&gt; IsDescriptionValid(&lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; description &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;String&lt;/span&gt;) &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ValidationResult&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;If&lt;/span&gt; (description &amp;lt;&amp;gt; &lt;span style="color:#0000ff"&gt;Nothing&lt;/span&gt; &lt;span style="color:#0000ff"&gt;And&lt;/span&gt; description.Split().Length &amp;lt; &lt;span style="color:#a52a2a"&gt;5&lt;/span&gt;) &lt;span style="color:#0000ff"&gt;Then&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Dim&lt;/span&gt; vr = &lt;span style="color:#0000ff"&gt;New&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ValidationResult&lt;/span&gt;(&lt;span style="color:#a31515"&gt;"Valid descriptions must have 5 or more words."&lt;/span&gt;)&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Return&lt;/span&gt; vr&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;If&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Return&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ValidationResult&lt;/span&gt;.Success&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Function&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Class&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Then to wire this up to the description property…&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:fc526784-965e-4701-9402-92e890f48ff8" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;CustomValidation&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;GetType&lt;/span&gt;(&lt;span style="color:#2b91af"&gt;PlateValidationRules&lt;/span&gt;),&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#a31515"&gt;"IsDescriptionValid"&lt;/span&gt;)&amp;gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; Description &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;String&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Then running the app, we see all our validations…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_52.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_52.png" width="240" height="173" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h5&gt;Personalization and Authentication&lt;/h5&gt;  &lt;p&gt;Lots of times in business applications we are dealing with valuable data that we need to make sure the user is authentication before we return in.&amp;#160; Luckily this is very easy to do with RIA Services.&amp;#160; Let’s go back to our DomainServices on the server and add the RequiresAuthentication attribute.&amp;#160; &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:d7a5b493-d395-4a17-bbd4-425100ad948d" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;RequiresAuthentication&lt;/span&gt;()&amp;gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;EnableClientAccess&lt;/span&gt;()&amp;gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;PlateViewDomainService&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Inherits&lt;/span&gt; &lt;span style="color:#2b91af"&gt;LinqToEntitiesDomainService&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;Of&lt;/span&gt; &lt;span style="color:#2b91af"&gt;DishViewEntities&lt;/span&gt;)&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Then when you run the application..&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_53.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_53.png" width="322" height="110" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So let’s log in…&amp;#160; I don’t have an account created yet, luckily the Business Application Template supports new user registration.&amp;#160; All this is based on ASP.NET Authentication system that has been around sense ASP.NET 2.0.&amp;#160; &lt;/p&gt;  &lt;p&gt;Here we are creating a new user…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_54.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_54.png" width="240" height="173" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And now we get our data…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_55.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_55.png" width="240" height="153" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now, that we have a user concept.. why don’t we add one more setting to let the user customize this page.&amp;#160;&amp;#160;&amp;#160; So we edit the web.config file to add a BackgroundColor.&amp;#160; &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:b020147d-6f49-47fd-9824-c159c78addb8" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color:#a31515"&gt;xml&lt;/span&gt;&lt;span style="color:#0000ff"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;version&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&lt;/span&gt;"&lt;span style="color:#0000ff"&gt;1.0&lt;/span&gt;"&lt;span style="color:#0000ff"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;encoding&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&lt;/span&gt;"&lt;span style="color:#0000ff"&gt;utf-8&lt;/span&gt;"&lt;span style="color:#0000ff"&gt;?&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;configuration&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;system.web&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;profile&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;properties&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;add&lt;/span&gt;&lt;span style="color:#0000ff"&gt; &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;FriendlyName&lt;/span&gt;"&lt;span style="color:#0000ff"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;add&lt;/span&gt;&lt;span style="color:#0000ff"&gt; &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;BackgroundColor&lt;/span&gt;"&lt;span style="color:#0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;properties&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;profile&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;And we go into the User.cs class on the server and add our BackgroundColor.&amp;#160; &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:c94c05d7-ba3f-49e0-b0a1-c24463123fbb" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Partial&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;User&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Inherits&lt;/span&gt; &lt;span style="color:#2b91af"&gt;UserBase&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Private&lt;/span&gt; _FriendlyName &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;String&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Private&lt;/span&gt; _BackgroundColor &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;String&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Property&lt;/span&gt; FriendlyName() &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;String&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Get&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Return&lt;/span&gt; _FriendlyName&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Get&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Set&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; value &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;String&lt;/span&gt;)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_FriendlyName = value&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Set&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Property&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Property&lt;/span&gt; BackgroundColor() &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;String&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Get&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Return&lt;/span&gt; _BackgroundColor&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Get&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Set&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; value &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;String&lt;/span&gt;)&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_BackgroundColor = value&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Set&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Property&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Now, back on the client, let’s build out UI using the DataSources window just as we have seen above.&amp;#160; But this time, I have created a very simple ColorPicker control in order to show that it is possible to use your own custom control.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_56.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_56.png" width="302" height="314" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Drag and drop that onto the form..&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_57.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_57.png" width="240" height="107" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then change the binding to be TwoWay using the databinding picker.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_58.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_58.png" width="240" height="136" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then I think we need a nice header here with the User name in it.&amp;#160; To so that, let’s add a TextBlock, set the fontsize to be big.&amp;#160;&amp;#160; Then do connect the dots databinding to write up to the user name.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_59.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_59.png" width="240" height="124" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then let’s use the string format databinding to customize this a bit..&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_60.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_60.png" width="321" height="194" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Next we put a Submit button.&amp;#160; &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:a9c52475-ebbd-41e7-875b-b3f020584e98" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;Private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Sub&lt;/span&gt; Button1_Click(&lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; sender &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; System.&lt;span style="color:#2b91af"&gt;Object&lt;/span&gt;, &lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; e &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; System.Windows.&lt;span style="color:#2b91af"&gt;RoutedEventArgs&lt;/span&gt;) &lt;span style="color:#0000ff"&gt;Handles&lt;/span&gt; Button1.Click&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Dim&lt;/span&gt; context = &lt;span style="color:#2b91af"&gt;WebContext&lt;/span&gt;.Current.Authentication&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UserDomainDataSource.SubmitChanges()&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;AddHandler&lt;/span&gt; UserDomainDataSource.SubmittedChanges, &lt;span style="color:#0000ff"&gt;AddressOf&lt;/span&gt; SubmittedChanges&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Sub&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;Private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Sub&lt;/span&gt; SubmittedChanges(&lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; sender &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Object&lt;/span&gt;, &lt;span style="color:#0000ff"&gt;ByVal&lt;/span&gt; e &lt;span style="color:#0000ff"&gt;As&lt;/span&gt; &lt;span style="color:#2b91af"&gt;SubmittedChangesEventArgs&lt;/span&gt;)&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;Dim&lt;/span&gt; context = &lt;span style="color:#2b91af"&gt;WebContext&lt;/span&gt;.Current.Authentication&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;If&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Not&lt;/span&gt; context.IsBusy &lt;span style="color:#0000ff"&gt;Then&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;context.LoadUser()&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;If&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff"&gt;Sub&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Now when we run it… we can modify the user settings.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_61.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_61.png" width="240" height="157" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The really cool part is that if the user goes to another machine and logs in, they get the exact same experience.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_62.png"&gt;&lt;img title="image" border="0" alt="image" src="http://brad_abrams.members.winisp.net/BlogPictures/PDC09TalkBuildingAmazingBusinessApplicat_A92D/image_thumb_62.png" width="240" height="159" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;Summary&lt;/h3&gt;  &lt;p&gt;Wow, we have seen a lot here.. We walked through end-to-end how to build a Business Application in Silverlight with .NET RIA Services.&amp;#160; We saw the query support, validating update, authorization and personalization as well as all the great new support in VS2010.&amp;#160;&amp;#160;&amp;#160; Enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9929580" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/VB/">VB</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/PDC09/">PDC09</category></item><item><title>Silverlight and RIA Services: Implementing Search</title><link>http://blogs.msdn.com/b/brada/archive/2009/11/25/silverlight-and-ria-services-implementing-search.aspx</link><pubDate>Wed, 25 Nov 2009 19:11:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9928730</guid><dc:creator>BradA</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/brada/rsscomments.aspx?WeblogPostID=9928730</wfw:commentRss><comments>http://blogs.msdn.com/b/brada/archive/2009/11/25/silverlight-and-ria-services-implementing-search.aspx#comments</comments><description>&lt;p&gt;Some of you likely noticed that my &lt;a href="http://blogs.msdn.com/brada/archive/2009/11/19/pdc09-talk-building-amazing-business-applications-with-silverlight-4-ria-services-and-visual-studio-2010.aspx"&gt;PDC09 demo included&lt;/a&gt; a stubbed out Search function that I didn’t really get to walkthrough during the talk.&amp;#160;&amp;#160; I thought I’d do a blog post showing how it is done.&lt;/p&gt;  &lt;p&gt;To get started you need: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx"&gt;Visual Studio 2010 Beta 2&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://silverlight.net/getstarted/silverlight-4-beta/"&gt;Silverlight 4&lt;/a&gt; Beta&amp;#160; (which includes RIA Services)&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You can download the &lt;a href="http://brad_abrams.members.winisp.net/Projects/PDC2009/MyApp.Search.zip"&gt;completed solution as well.&lt;/a&gt;&amp;#160; and be sure to check out &lt;a href="http://blogs.msdn.com/brada/archive/2009/11/19/pdc09-talk-building-amazing-business-applications-with-silverlight-4-ria-services-and-visual-studio-2010.aspx"&gt;the full talk&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/RIAServicesImplementingSearch_14424/image.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://brad_abrams.members.winisp.net/BlogPictures/RIAServicesImplementingSearch_14424/image_thumb.png" width="383" height="192" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;First let’s write a new method on the DomainService to return the search results.&amp;#160; In this case I want to return any Plates who’s name matches (grouped by Restaurant)&amp;#160; and any Restaurant who’s name matches.&amp;#160; &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:4a3298e5-1df5-4c0a-937e-e5f7af0ea945" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af"&gt;IQueryable&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Restaurant&lt;/span&gt;&amp;gt; SearchRestaurants(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; term)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#008000"&gt;//Find all plates that match, grouped by restaurant&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;var&lt;/span&gt; restaurantPlatesList = &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.ObjectContext.Restaurants&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.Where (r =&amp;gt; r.Plates.Any (p=&amp;gt;p.Name.Contains(term)))&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.OrderBy(k =&amp;gt; k.ID);&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;foreach&lt;/span&gt; (&lt;span style="color:#0000ff"&gt;var&lt;/span&gt; restaurant &lt;span style="color:#0000ff"&gt;in&lt;/span&gt; restaurantPlatesList)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;var&lt;/span&gt; plateList = ObjectContext.Plates&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.Where(p =&amp;gt; p.RestaurantID == restaurant.ID)&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.Where(p =&amp;gt; p.Name.Contains(term));&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;foreach&lt;/span&gt; (&lt;span style="color:#0000ff"&gt;var&lt;/span&gt; plate &lt;span style="color:#0000ff"&gt;in&lt;/span&gt; plateList)&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;restaurant.Plates.Add(plate);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#008000"&gt;//Find all restaurants that match&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;var&lt;/span&gt; restaurantsList = &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.ObjectContext.Restaurants&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.Where(r =&amp;gt; r.Name.Contains(term) &amp;amp;&amp;amp;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;!restaurantPlatesList.Contains(r));&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;return&lt;/span&gt; restaurantPlatesList.Concat(restaurantsList);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;In line 1, you see that we are defining a new query that returns Restaurants… this one has a different name, and takes a search term as an argument.&amp;#160; &lt;/p&gt;  &lt;p&gt;In line 4-6, we are getting all the restaurants that that have any plates that match the search term.&lt;/p&gt;  &lt;p&gt;In line 7-14, we are looping through all those restaurants and manually adding the plates that match to the collection we will return.&amp;#160; Effectively, we are manually creating the instance in just the shape we need it for the client.&lt;/p&gt;  &lt;p&gt;In line 17-18, we are getting the Restaurants that match and that are not already included.&amp;#160; &lt;/p&gt;  &lt;p&gt;and finally, in line 21, we return the concatenation of the two queries.&amp;#160; &lt;/p&gt;  &lt;p&gt;Notice that this query is designed to return Restaurants AND the Plates that are related.&amp;#160;&amp;#160; By default, related entities are not included (in order to save bandwidth).. so we need to go into the metadata file and explicitly include them.&lt;/p&gt;  &lt;p&gt;   &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:5388a514-7769-46bd-9c45-2ce0329c3a8f" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;internal&lt;/span&gt; &lt;span style="color:#0000ff"&gt;sealed&lt;/span&gt; &lt;span style="color:#0000ff"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;RestaurantMetadata&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&lt;span style="color:#2b91af"&gt;Include&lt;/span&gt;]&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af"&gt;EntityCollection&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Plate&lt;/span&gt;&amp;gt; Plates;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now, in the Silverlight client.&amp;#160; First we need to wire up the Search button on MainPage.xaml..&amp;#160;&amp;#160; There we just need to follow the same pattern we saw in the earlier post:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:4cacc041-2637-4b22-ae05-9b9a2e7964dc" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; button1_Click(&lt;span style="color:#0000ff"&gt;object&lt;/span&gt; sender, &lt;span style="color:#2b91af"&gt;RoutedEventArgs&lt;/span&gt; e)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ContentFrame.Navigate(&lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Uri&lt;/span&gt;(&lt;span style="color:#a31515"&gt;"/Search?term="&lt;/span&gt; + searchBox.Text,&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#2b91af"&gt;UriKind&lt;/span&gt;.Relative));&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Then the search page, again we build it the same way as we saw in the earlier post, by simply drag and dropping from the data sources window.&amp;#160;&amp;#160; Notice that we now have two different query methods for Restaurants.&amp;#160; So we simply select the right one and then drag and drop on the form as we saw in the earlier post:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/RIAServicesImplementingSearch_14424/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://brad_abrams.members.winisp.net/BlogPictures/RIAServicesImplementingSearch_14424/image_thumb_3.png" width="291" height="411" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;After we get the UI laid out correctly you end up with a pager and all the columns set right. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/RIAServicesImplementingSearch_14424/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://brad_abrams.members.winisp.net/BlogPictures/RIAServicesImplementingSearch_14424/image_thumb_4.png" width="420" height="264" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Then wire up the parameter to the SearchRestaurants query method to the query string…&lt;/p&gt;  &lt;p&gt;   &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:0044bbcb-5a30-4232-93e3-d8c794c747d1" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; OnNavigatedTo(&lt;span style="color:#2b91af"&gt;NavigationEventArgs&lt;/span&gt; e)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.restaurantDomainDataSource.QueryParameters.Add(&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;new&lt;/span&gt; System.Windows.Data.&lt;span style="color:#2b91af"&gt;Parameter&lt;/span&gt;()&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ParameterName = &lt;span style="color:#a31515"&gt;"term"&lt;/span&gt;,&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Value = NavigationContext.QueryString[&lt;span style="color:#a31515"&gt;"term"&lt;/span&gt;]&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/p&gt;  &lt;p&gt;Now i’d like to display the Plates for each Restaurant that is returned.&amp;#160; To do that, i’ll make use of the RowDetails feature of DataGrid. &lt;/p&gt;  &lt;p&gt;   &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:518fb955-c692-470b-a31d-7b2addcde609" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataGrid.RowDetailsTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;ListBox&lt;/span&gt;&lt;span style="color:#ff0000"&gt; ItemsSource&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Plates&lt;/span&gt;&lt;span style="color:#0000ff"&gt;}"&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Orientation&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="Horizontal"&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Image&lt;/span&gt; &lt;span style="color:#ff0000"&gt; Source&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Path&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=IconPath,&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Converter&lt;/span&gt;&lt;span style="color:#0000ff"&gt;={&lt;/span&gt;&lt;span style="color:#a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="color:#ff0000"&gt; ImagePathConverter1&lt;/span&gt;&lt;span style="color:#0000ff"&gt;}}"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Margin&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="40,0,10,0"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Image&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt; &lt;span style="color:#ff0000"&gt; Text&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Path&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=Name}"&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Width&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="400"&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; TextWrapping&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="Wrap"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; FontWeight&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="Bold"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Text&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Path&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=Description}"&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Width&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="400"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; TextWrapping&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="Wrap"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;HyperlinkButton&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Click&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="HyperlinkButton_Click"&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; Content&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="Details..."&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ff0000"&gt; NavigateUri&lt;/span&gt;&lt;span style="color:#0000ff"&gt;="{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; ID&lt;/span&gt;&lt;span style="color:#0000ff"&gt;}" /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;ListBox&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;data&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataGrid.RowDetailsTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/p&gt;  &lt;p&gt;Run it and we get this sort of view… &lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/RIAServicesImplementingSearch_14424/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://brad_abrams.members.winisp.net/BlogPictures/RIAServicesImplementingSearch_14424/image_thumb_5.png" width="507" height="349" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Notice the URL includes the search term, so I can send this around in email to share my search results bookmark it for future reference.&amp;#160; &lt;/p&gt;  &lt;p&gt;Now, you might want to drill into the details on what of these plates… so let’s handle that “Details..” hyperlink.&amp;#160; In the code behind for the search page, we handle navigating to the Plates page with a the right query string paramaters.&lt;/p&gt;  &lt;p&gt;   &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:7ef8ce23-10cf-46a0-9fe4-ddd80b75dd3c" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; HyperlinkButton_Click(&lt;span style="color:#0000ff"&gt;object&lt;/span&gt; sender, &lt;span style="color:#2b91af"&gt;RoutedEventArgs&lt;/span&gt; e)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;var&lt;/span&gt; button = sender &lt;span style="color:#0000ff"&gt;as&lt;/span&gt; &lt;span style="color:#2b91af"&gt;HyperlinkButton&lt;/span&gt;;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;var&lt;/span&gt; plate = button.DataContext &lt;span style="color:#0000ff"&gt;as&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Plate&lt;/span&gt;;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NavigationService.Navigate(&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Uri&lt;/span&gt;(&lt;span style="color:#a31515"&gt;"/Plates?restaurantId="&lt;/span&gt; + plate.RestaurantID + &lt;span style="color:#a31515"&gt;"&amp;amp;"&lt;/span&gt; +&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#a31515"&gt;"plateId="&lt;/span&gt; + plate.ID,&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#2b91af"&gt;UriKind&lt;/span&gt;.Relative));&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;}&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now we need to make a slight tweak to the Plates page because it does no know about the plateId query string parameter.&amp;#160; &lt;/p&gt;  &lt;p&gt;   &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:35d1edfd-622d-4b53-a8ad-7f4172d687f8" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #fff; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; OnNavigatedTo(&lt;span style="color:#2b91af"&gt;NavigationEventArgs&lt;/span&gt; e)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#008000"&gt;//Handle RestaurantID&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;plateDomainDataSource.QueryParameters.Add(&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;new&lt;/span&gt; System.Windows.Data.&lt;span style="color:#2b91af"&gt;Parameter&lt;/span&gt;()&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ParameterName = &lt;span style="color:#a31515"&gt;"resId"&lt;/span&gt;,&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Value = NavigationContext.QueryString[&lt;span style="color:#a31515"&gt;"restaurantId"&lt;/span&gt;]&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#008000"&gt;//Handle PlateID&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;var&lt;/span&gt; qs = NavigationContext.QueryString;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;if&lt;/span&gt; (qs.ContainsKey(&lt;span style="color:#a31515"&gt;"plateId"&lt;/span&gt;))&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.plateDomainDataSource.FilterDescriptors = &lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;FilterDescriptorCollection&lt;/span&gt;();&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.plateDomainDataSource.FilterDescriptors.Add(&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;FilterDescriptor&lt;/span&gt;(&lt;span style="color:#a31515"&gt;"ID"&lt;/span&gt;,&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#2b91af"&gt;FilterOperator&lt;/span&gt;.IsEqualTo, qs[&lt;span style="color:#a31515"&gt;"plateId"&lt;/span&gt;]));&lt;/li&gt; &lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;}&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The first few lines to handle the RestaurantID were already there, so we just needed to add the code to handle the PlateID..&amp;#160; Notice we don’t need to change the query method on the server for this, we just add a new where clause that will get sent to the server and executed there.&amp;#160; &lt;/p&gt;  &lt;p&gt;The result:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://brad_abrams.members.winisp.net/BlogPictures/RIAServicesImplementingSearch_14424/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://brad_abrams.members.winisp.net/BlogPictures/RIAServicesImplementingSearch_14424/image_thumb_6.png" width="489" height="336" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Again, notice the URL, something we can bookmark or send around in email, etc.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I hope you got something valuable from this walkthrough… You can download the &lt;a href="http://brad_abrams.members.winisp.net/Projects/PDC2009/MyApp.Search.zip"&gt;completed solution as well&lt;/a&gt; and be sure to check out &lt;a href="http://blogs.msdn.com/brada/archive/2009/11/19/pdc09-talk-building-amazing-business-applications-with-silverlight-4-ria-services-and-visual-studio-2010.aspx"&gt;the full talk&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Have fun!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9928730" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/brada/archive/tags/Silverlight/">Silverlight</category><category domain="http://blogs.msdn.com/b/brada/archive/tags/RIAServices/">RIAServices</category></item></channel></rss>
