<?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></channel></rss>