<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Pedram Rezaei</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/pedram/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/pedram/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 27 Jul 2016 06:09:04 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Detail look at “Power BI Q&amp;A” – Video</title>
      <link>https://docs.microsoft.com/archive/blogs/pedram/detail-look-at-power-bi-qa-video</link>
      <pubDate>Thu, 03 Oct 2013 11:49:00 GMT</pubDate>
      <dc:creator><![CDATA[Pedram Rezaei - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pedram/2013/10/03/detail-look-at-power-bi-qa-video/</guid>
      <description><![CDATA[In this video Pedram Rezaei from the Power BI team and Marc Reguera from Microsoft Finance...]]></description>
      <content:encoded><![CDATA[<p>In this video <a href="http://blogs.msdn.com/b/pedram">Pedram Rezaei</a> from the Power BI team and Marc Reguera from Microsoft Finance demonstrate how one can simply load a Power Pivot model into Power BI for Office 365 and intuitively begin asking questions in natural language against that dataset.</p>
<p>[View:https://www.youtube.com/watch?v=PSczHlIH-ig]</p>
<p>You can read more about &ldquo;Q&amp;A&rdquo; <a href="http://blogs.msdn.com/b/powerbi/">here</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>Microsoft adds natural language search over data to Office 365</title>
      <link>https://docs.microsoft.com/archive/blogs/pedram/microsoft-adds-natural-language-search-over-data-to-office-365</link>
      <pubDate>Fri, 27 Sep 2013 01:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Pedram Rezaei - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pedram/2013/09/27/microsoft-adds-natural-language-search-over-data-to-office-365/</guid>
      <description><![CDATA[We are excited to announce a preview of Q&amp;A, a natural language based experience for interacting...]]></description>
      <content:encoded><![CDATA[<p>We are excited to announce a preview of <strong>Q&amp;A</strong>, a natural language based experience for interacting with data as part of the <a href="http://www.powerbi.com">Power BI for Office 365</a> offering.</p>
<p>Q&amp;A builds upon Microsoft's first in class Business Intelligence platform and allows the use of <em>natural language</em> to discover, understand, and report over your own datasets.</p>
<p>In this preview release Q&amp;A is configured to work over two sample Excel models: one pertaining to summer Olympics medalists between 1896 and 2012 and another containing retail bar sales.</p>
<p>Let's introduce Q&amp;A's through a series of examples using these 2 datasets. You can try these out for yourself if you head over to <a href="http://www.powerbi.com">http://www.powerbi.com</a> and register for the preview. If you are already registered, log on, enable the sample spreadsheets, and try it out for yourself.</p>
<p>First, let's find all the medalists that participated in the 2008 Beijing Summer Olympics:</p>
<p><strong> "Show Beijing athletes" </strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/4263.1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/4263.1.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/4263.1.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/4263.1.png" alt="" border="0" /></a></p>
<p>In this example, the Excel workbook with data about summer Olympics has been saved to Office 365. Q&amp;A interprets the search query and displays the corresponding information from the workbook to create a list of athletes that participated at the Beijing 2008 Olympics.</p>
<p>It's nice to get a list of medalists but maybe you want to total number of medalists in a given summer Olympics. Let's try that with the 2012 London Olympics.</p>
<p><strong>"Show the total number of medalists at the London 2012 games" </strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/0572.2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/0572.2.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/0572.2.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/0572.2.png" alt="" border="0" /></a></p>
<p>Similarly this sentence is being interpreted to count the number of distinct athletes that won medals at the last London Olympics.</p>
<p>Beyond being able to ask for a count of medalists, you can ask a number of interesting questions with Q&amp;A that provide far deeper insights. Let's start with finding the number of medals that have been won at each summer Olympics.</p>
<p><strong>"How many medals were won each year?" </strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/1512.3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/1512.3.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/1512.3.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/1512.3.png" alt="" border="0" /></a></p>
<p>Further, Q&amp;A automatically chooses a suitable visualization based on what is requested. In the above example, Q&amp;A plots a line chart that shows the number of medals that were awarded throughout the years. There may be times where you want to control the specific visual that Q&amp;A uses when rendering the answer to your question.</p>
<p><strong>"Show number of medalists by year as column chart" </strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/3482.4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/3482.4.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/3482.4.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/3482.4.png" alt="" border="0" /></a></p>
<p>One can easily direct the system to display a different visualization. In the above example, "as column chart" changed the visualization type from a line chart to a column chart.</p>
<p>Q&amp;A can understand the deeper meaning of questions. Take for example the following question:</p>
<p><strong>"Which athletes won the most gold medals in London 2012?" </strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/2211.5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/2211.5.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/2211.5.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/2211.5.png" alt="" border="0" /></a></p>
<p>Here, Q&amp;A interpreted what gold medals are and intelligently decided that the result should be sorted by the medal count to reflect the true meaning of "most" in this context.</p>
<p>Beyond being able to intelligently understand sorting and the specific meaning of "most" in the above question, Q&amp;A has the ability to understand questions about time in a number of different ways.</p>
<p><strong>"How many medals did Michael Phelps win in the past 5 years?" </strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/3582.6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/3582.6.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/3582.6.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/3582.6.png" alt="" border="0" /></a></p>
<p>Q&amp;A understands the context of the question based on the timeframe, the model, and the data within it. <strong> </strong></p>
<p>All of these aspects of Q&amp;A integrate well together from choosing the most appropriate visualization to applying the correct time intelligence to the question. <strong> </strong></p>
<p>"<strong>Show the number of medalists from Europe who competed in 2004 vs. 2012 by their countries</strong>"</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/3240.7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/3240.7.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/3240.7.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/3240.7.png" alt="" border="0" /></a></p>
<p>In this example Q&amp;A automatically chose to display 2 maps one for each Olympic games. It opted to display maps because the country column is marked as a geography data column.</p>
<p>When using natural language there are often cases where the question posed contains significant ambiguity. For example:</p>
<p><strong>"Who from Vietnam won what when?" </strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/8507.8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/8507.8.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/8507.8.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/8507.8.png" alt="" border="0" /></a><br />&nbsp;</p>
<p>Here, Q&amp;A is correctly mapping "Who" to the medalists from Vietnam, "What" to the events that they had won and "When" to the year in which they won those medals.</p>
<p>The Summer Olympics model allows a number of interesting questions, however, Q&amp;A can be used across a variety of datasets and domains. Let's walk through a number of examples using the retail bar sales sample model. I will begin with a question that requires some context:</p>
<p><strong> "Popular Rum drinks" </strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/0820.9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/0820.9.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/0820.9.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/0820.9.png" alt="" border="0" /></a></p>
<p>In this example, "Rum drinks" is understood as any drinks that contains Rum as an ingredient and "popular" is defined as an adjective over the drinks entity that sorts the result by the "popularity" column.</p>
<p>Also "number sold" is defined as the main synonyms of the popularity column ensuring that it is used instead of "popularity" in the restatement highlighted in blue.</p>
<p>As you see, Q&amp;A is adaptable to a wide range of questions.</p>
<p><strong> "Which bartenders had the highest sales for non-alcoholic drinks?" </strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/2211.10.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/2211.10.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/2211.10.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/2211.10.png" alt="" border="0" /></a></p>
<p>Here "highest sales" is understood as a request to sort the results by "total sales" in a descending order.</p>
<p>The next example combines a few of the features we saw earlier into a pretty common Business Intelligence question where an aggregate function is applied to a numeric value grouped by a particular dimension and filtered down to a time window:</p>
<p><strong>"Total beer and liquor sales by hours since opening for 2010 and 2011 as a line chart" </strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/8484.11.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/8484.11.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/8484.11.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/8484.11.png" alt="" border="0" /></a></p>
<p>So what will you need to get Power BI Q&amp;A to work with your organization's dataset?</p>
<p>You'll need an Excel spreadsheet with a Power Pivot model saved to your Power BI site in Office 365. If you are using Excel and Power Pivot today, you are on the right track to use Q&amp;A over your own data once it is available.</p>
<p>In the meantime, head over to <a href="http://www.powerbi.com">http://www.powerbi.com</a> and register for the preview. If you are already registered, log on, enable the sample spreadsheets, and try it for yourself. You can also read more about Power BI <a href="http://office.microsoft.com/en-us/office365-sharepoint-online-enterprise-help/power-bi-getting-started-guide-HA104103589.aspx">here</a>.</p>
<p>&nbsp;</p>
<p><a href="http://blogs.msdn.com/pedram">Pedram Rezaei</a></p>
<p>Software Architect on Power BI Q&amp;A</p>]]></content:encoded>
    </item>
    <item>
      <title>Q&amp;A feature of Power BI</title>
      <link>https://docs.microsoft.com/archive/blogs/pedram/qa-feature-of-power-bi</link>
      <pubDate>Mon, 29 Jul 2013 20:27:00 GMT</pubDate>
      <dc:creator><![CDATA[Pedram Rezaei - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pedram/2013/07/29/qa-feature-of-power-bi/</guid>
      <description><![CDATA[At our Worldwide Partner Conference in Houston we unveiled Power BI for Office 365, a self-service...]]></description>
      <content:encoded><![CDATA[<p>At our <a title="Worldwide Partner Conference" href="http://www.digitalwpc.com/Pages/Home.aspx#fbid=V9PYz-tucgt">Worldwide Partner Conference</a> in Houston we unveiled <a title="Power BI for Office 365" href="http://blogs.technet.com/b/dataplatforminsider/archive/2013/07/08/introducing-power-bi-for-office-365.aspx">Power BI for Office 365</a>, a self-service business intelligence (BI) solution delivered through Excel and Office 365 which provides information workers with data analysis and visualization capabilities to identify deeper business insights from their on-premises and cloud data. One of the most exciting new features of Power BI is Q&amp;A, a natural language based experience for interacting with data. Since the announcement we&rsquo;ve received many requests for more information about Q&amp;A, so here&rsquo;s a bit about this feature of Power BI.<br />Q&amp;A builds upon our first in class BI platform and allows the use of natural language to find, understand, and report over your data. Here are a few examples:</p>
<p><strong>&ldquo;Show London clients&rdquo;</strong></p>
<p><strong><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/6724.image1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/6724.image1.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/6724.image1.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/6724.image1.png" alt="" border="0" /></a></strong></p>
<p>&nbsp;</p>
<p>In this example, an Excel workbook with data about customers and their locations has been saved to Office 365. Q&amp;A is interpreting the search query and displaying corresponding information from the workbook to create a list of customers that are based in London.</p>
<p><strong>&ldquo;Show number of products&rdquo;</strong><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/6175.image2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/6175.image2.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/6175.image2.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/6175.image2.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>Similarly, &ldquo;show number of products&rdquo; is being interpreted to count the number of products found in the data source.</p>
<p><strong>&ldquo;Number of songs per year&rdquo;</strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/3531.image3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/3531.image3.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/3531.image3.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/3531.image3.png" alt="" border="0" /></a></p>
<p>Further, Q&amp;A automatically chooses a suitable visualization based on what is requested.</p>
<p><strong>&ldquo;Total number of employees for finance, HR, marketing in Europe by employee country&rdquo;</strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/8686.image4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/8686.image4.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/8686.image4.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/8686.image4.png" alt="" border="0" /></a></p>
<p>In this example, Q&amp;A automatically chose to display three maps, one for each division. It opted to display maps because the country column is marked as a geography data column.</p>
<p><strong>&ldquo;Show our sales pipeline with opportunity size greater than $20,000&rdquo;</strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/1602.image5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/1602.image5.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/1602.image5.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/1602.image5.png" alt="" border="0" /></a><br />&nbsp;</p>
<p>So what will you need to get Power BI Q&amp;A to work with your organization&rsquo;s dataset? An Excel spreadsheet with a Power Pivot model saved to a Power BI site in Office 365. So, if you are using Excel and Power Pivot today, you are on the right track to use Q&amp;A over your own data once it is available.<br />I&rsquo;ll be posting more about the features included in Power BI so stay tuned here for more updates. In the meantime head over to <a href="http://www.powerbi.com">http://www.powerbi.com</a> and register for the preview.</p>
<p>Pedram Rezaei</p>
<p>Software Architect&nbsp;- Power BI Q&amp;A</p>]]></content:encoded>
    </item>
    <item>
      <title>Natural language capability of Power BI</title>
      <link>https://docs.microsoft.com/archive/blogs/pedram/natural-language-capability-of-power-bi</link>
      <pubDate>Mon, 15 Jul 2013 22:52:00 GMT</pubDate>
      <dc:creator><![CDATA[Pedram Rezaei - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pedram/2013/07/15/natural-language-capability-of-power-bi/</guid>
      <description><![CDATA[Over the past 18 months I have been working as the software architect of an amazing piece of...]]></description>
      <content:encoded><![CDATA[<p>Over the past 18 months I have been working as the software architect of an amazing piece of technology that is set to revolutionize how people will interact with data. It started as an incubation project and soon matured to become this amazing service that we just recently unveiled to the world. &ldquo;InfoNav&rdquo; is the codename for this technology which is a feature of <a title="Power BI" href="http://office.microsoft.com/en-us/excel/power-bi-FX104080667.aspx" target="_blank">Power BI</a>. There has been a lot written about this topic but really not a lot of it has been official so over the next few months I will share with you some of the details of this work. For now though, take a look at a demo of this technology presented by Amir Netz at the WPC conference: [View:https://www.youtube.com/watch?v=Jsa-5LGx_IY].</p>
<p><em><strong>Update</strong></em>:</p>
<ul>
<li>Read more <a href="http://blogs.msdn.com/b/pedram/archive/2013/07/30/q-amp-a-feature-of-power-bi.aspx">here</a></li>
</ul>
<p>Pedram Rezaei</p>
<p>Software Architect, Microsoft</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Natural Interaction and Microsoft BI</title>
      <link>https://docs.microsoft.com/archive/blogs/pedram/natural-interaction-and-microsoft-bi</link>
      <pubDate>Sun, 08 Jan 2012 22:39:00 GMT</pubDate>
      <dc:creator><![CDATA[Pedram Rezaei - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pedram/2012/01/08/natural-interaction-and-microsoft-bi/</guid>
      <description><![CDATA[Today, Microsoft released the official Kinect for Windows SDK. Here is something we have been...]]></description>
      <content:encoded><![CDATA[<p>Today, Microsoft released the official <a href="http://www.microsoft.com/en-us/kinectforwindows/">Kinect for Windows SDK</a>. Here is something we have been experimenting with here in the SQL Server BI product group that you might find interesting.</p>
<p>A while ago, at SQL PASS Summit&nbsp;2011 in Seattle, WA, I demoed turning any random surface or wall into a touch screen using a single Microsoft Kinect device. I also demoed controlling&nbsp;Microsoft&rsquo;s latest BI reporting tool which provides easy data exploration, visualization and presentation capabilities, Power View, through natural language and simple gestures.</p>
<p>Let&rsquo;s start with a video of the above scenarios (You hear me say the word "Crescent" in the video. Crescent is the code-name for <a title="Power View" href="http://www.microsoft.com/sqlserver/en/us/future-editions/SQL-Server-2012-breakthrough-insight.aspx">Power View</a>):<br />[View:https://www.youtube.com/watch?v=ShyNV9hHPpo&amp;feature=youtu.be]</p>
<h2>Using Kinect to turn any wall into a touch screen</h2>
<p>Using the Skeletal Tracking feature of the official <a href="http://www.microsoft.com/en-us/kinectforwindows/">Kinect for Windows SDK</a>, it is possible to track the position of &ldquo;joints&rdquo; such as arms and hands. The data points provided for each joint include depth. It is, therefore possible to gather enough calibration data to correctly map the position of the hand to screen coordinates. It is also possible to calculate how far the projection surface area is from the Kinect allowing for the detection of the touch gesture:&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/0741.Touch.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/0741.Touch.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/77/30/0741.Touch.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-77-30/0741.Touch.png" /></a>&nbsp;</p>
<p>The part that is not demoed in the above video is the calibration stage. Currently it takes about a couple of minutes for one to calibrate the system by touching the wall at different locations. One could imagine advancing the algorithm to remove the need for that level of calibration.</p>
<h2>Using Kinect and Microsoft Speech to control Power View</h2>
<p>In the second section of the video, you saw some really interesting ways of controlling Power View through voice. As you saw, we can navigate between the views, sort different data regions, and filter the selected view based on the attributes in the semantic model.</p>
<p>The voice is picked up by the microphone array built into Kinect, and then passed onto Microsoft Speech for recognition. The rest is pretty straight forward: voice commands are converted to commands within Power View.</p>
<p>Pedram Rezaei</p>
<p></p>
<p></p>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>Building a LINQ Provider</title>
      <link>https://docs.microsoft.com/archive/blogs/pedram/building-a-linq-provider</link>
      <pubDate>Mon, 18 Jan 2010 20:53:00 GMT</pubDate>
      <dc:creator><![CDATA[Pedram Rezaei - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pedram/2010/01/18/building-a-linq-provider/</guid>
      <description><![CDATA[Throughout this article, I will build a simple IQueryable provider similar to the LINQ to SQL...]]></description>
      <content:encoded><![CDATA[<P><EM>Throughout this article, I will build a simple IQueryable provider similar to the LINQ to SQL provider demonstrating what is needed to build a custom provider that is capable of executing LINQ queries and performing create, update and delete operations.&nbsp;Read the rest on MSDN&nbsp;at </EM><A href="http://msdn.microsoft.com/en-us/vcsharp/ee672195.aspx">http://msdn.microsoft.com/en-us/vcsharp/ee672195.aspx</A></P>
<P>Pedram</P>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Introducing Parallel Extensions to the .NET Framework</title>
      <link>https://docs.microsoft.com/archive/blogs/pedram/introducing-parallel-extensions-to-the-net-framework</link>
      <pubDate>Wed, 06 Aug 2008 16:35:00 GMT</pubDate>
      <dc:creator><![CDATA[Pedram Rezaei - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pedram/2008/08/06/introducing-parallel-extensions-to-the-net-framework/</guid>
      <description><![CDATA[There is no escaping from concurrency challenges... or is there? 
(A slightly modified version of...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>There is no escaping from concurrency challenges... or is there? </FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><I style="mso-bidi-font-style: normal"><FONT face=Calibri size=3>(A slightly modified version of this article was published in the August 2008 edition of the </FONT><A href="http://msdn.microsoft.com/en-gb/flash/default.aspx"><FONT face=Calibri size=3>MSDN Flash newsletter</FONT></A><FONT size=3><FONT face=Calibri>)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></I></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>Dual, quad, and eight-core processors are becoming the norm. <I style="mso-bidi-font-style: normal">Is your application capable of utilising all available processors?</I> In order to achieve this level of utilisation on an <I style="mso-bidi-font-style: normal">n</I>-processor machine, an application ideally needs at least <I style="mso-bidi-font-style: normal">n</I> threads concurrently performing operations. </FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>Although writing multi-threaded applications has become simpler over the years, many still find it challenging. Also many of the constructs such as the .NET ThreadPool have </FONT><A href="http://www.bluebytesoftware.com/blog/2006/07/09/CLRThreadPoolInjectionStutteringProblems.aspx"><FONT face=Calibri size=3>deficiencies</FONT></A><FONT face=Calibri size=3> that make them less suitable as the </FONT><A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=633F9F08-AAD9-46C4-8CAE-B204472838E1&amp;displaylang=en"><FONT face=Calibri size=3>manycore shift</FONT></A><FONT face=Calibri size=3> begins to accelerate. </FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>Over the past few years, Microsoft has been hard at work developing a new set of parallel extensions for .NET, aptly named Parallel Extensions to the .NET Framework. One of the additions is a set of lightweight and scalable thread-safe </FONT><A href="http://blogs.msdn.com/pedram/archive/tags/CDS/default.aspx"><FONT face=Calibri size=3>data structures and synchronization primitives</FONT></A><FONT face=Calibri size=3> such as a concurrent dictionary and a spin lock.</FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>It also includes an implementation of LINQ-to-Objects that automatically executes queries in parallel, scaling to utilise most or all of the available processors without developers explicitly managing the distribution of work across all processors. This technology is called </FONT><A href="http://msdn.microsoft.com/en-us/magazine/cc163329.aspx"><FONT face=Calibri color=#0000ff size=3>Parallel LINQ or PLINQ</FONT></A><FONT face=Calibri size=3> and the query syntax is almost identical to that of LINQ-to-Objects.</FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">var</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"> q = <SPAN style="COLOR: blue">from</SPAN> c <SPAN style="COLOR: blue">in</SPAN> customers<B style="mso-bidi-font-weight: normal">.AsParallel()</B><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">join</SPAN> r <SPAN style="COLOR: blue">in</SPAN> regions <SPAN style="COLOR: blue">on</SPAN> c.RegionID <SPAN style="COLOR: blue">equals</SPAN> r.RegionID <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">where</SPAN> c.City == <SPAN style="COLOR: #a31515">"London"</SPAN> &amp;&amp; r.Name == <SPAN style="COLOR: #a31515">"Kingston"<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">select</SPAN> c;</SPAN><SPAN class=MtpsInlineCodeSnippet><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt"><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>When a repetitive computation can be parallelised, the Parallel Extensions to the .NET Framework offers a few interesting data-oriented operations such as <B style="mso-bidi-font-weight: normal">For</B> and <B style="mso-bidi-font-weight: normal">ForEach</B> that execute a loop in which iterations may run in parallel on parallel hardware. For example the following classic <I style="mso-bidi-font-style: normal">foreach</I> loop can easily be converted to a parallel <I style="mso-bidi-font-style: normal">foreach</I>:</FONT></P>
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-yfti-tbllook: 1184; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: none; mso-border-insidev: none" cellSpacing=0 cellPadding=0 border=0 class="MsoTableGrid">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes">
<TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #f0f0f0; WIDTH: 133pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" vAlign=top width=177>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"><FONT face=Calibri size=3>Sequential execution</FONT></P></TD>
<TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #f0f0f0; WIDTH: 1cm; PADDING-TOP: 0cm; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" vAlign=top width=38>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: Wingdings; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'; mso-ascii-font-family: Consolas; mso-hansi-font-family: Consolas; mso-themecolor: text2; mso-char-type: symbol; mso-symbol-font-family: Wingdings"><SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings">è</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'; mso-themecolor: text2"><o:p></o:p></SPAN></P></TD>
<TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #f0f0f0; WIDTH: 300.75pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" vAlign=top width=401>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">foreach</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"> (<SPAN style="COLOR: blue">var</SPAN> c <SPAN style="COLOR: blue">in</SPAN> formulae)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Calculate(f);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"><o:p><FONT face=Calibri size=3>&nbsp;</FONT></o:p></P></TD></TR>
<TR style="mso-yfti-irow: 1; mso-yfti-lastrow: yes">
<TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #f0f0f0; WIDTH: 133pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" vAlign=top width=177>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"><FONT size=3><FONT face=Calibri><I style="mso-bidi-font-style: normal">Possible</I> parallel execution</FONT></FONT></P></TD>
<TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #f0f0f0; WIDTH: 1cm; PADDING-TOP: 0cm; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" vAlign=top width=38>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: Wingdings; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'; mso-ascii-font-family: Consolas; mso-hansi-font-family: Consolas; mso-themecolor: text2; mso-char-type: symbol; mso-symbol-font-family: Wingdings"><SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings">è</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'; mso-themecolor: text2"><o:p></o:p></SPAN></P></TD>
<TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #f0f0f0; WIDTH: 300.75pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" vAlign=top width=401>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">Parallel</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">.ForEach(formulae, f =&gt; Calculate(f));</SPAN><SPAN style="FONT-FAMILY: Consolas"><o:p></o:p></SPAN></P></TD></TR></TBODY></TABLE>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><o:p><FONT face=Calibri size=3>&nbsp;</FONT></o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>The actual parallelisation of actions is managed by the Task Parallel Library (TPL) that provides an abstraction layer on top of raw threads. TPL uses the notion of <B style="mso-bidi-font-weight: normal">Task</B> that is the smallest unit of work and could potentially be executed by any thread owned by TPL. Therefore correctly identifying tasks that could be executed in parallel is crucial. It is then the job of the scheduler component of TPL to decide whether those tasks should execute sequentially or in parallel. This decision is usually made based on available system resources and possible user preferences.</FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">// Create a task to call Calculate(object o) and schedule it for execution<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">Task</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"> t = <SPAN style="COLOR: #2b91af">Task</SPAN>.Create(Calculate);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">// Other activities...<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">// Wait for this task to complete<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">t.Wait();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>Developing concurrent applications requires a shift in mindset. For example, only a single exception can be thrown at any one time when sequentially executing a <I style="mso-bidi-font-style: normal">for</I> loop. However executing the same loop in parallel may warrant the need for dealing with multiple concurrent exceptions. There are also a few </FONT><A href="http://blogs.msdn.com/pfxteam/archive/2007/12/17/6792952.aspx"><FONT face=Calibri color=#0000ff size=3>parallelism blockers</FONT></A><FONT face=Calibri size=3> that should be avoided if you are planning to benefit from Parallel Extensions to the .NET Framework when it is released.</FONT></P><SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-language: EN-US; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-ansi-language: EN-GB; mso-fareast-theme-font: minor-latin; mso-bidi-language: AR-SA; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin">There is a lot of promise in Parallel Extensions. If you want to find out more, I’d encourage you to download the <A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=348F73FD-593D-4B3C-B055-694C50D2B0F3">June 2008 Community Technology Preview build</A>. </SPAN>]]></content:encoded>
    </item>
    <item>
      <title>ADO.NET Data Services: CLR-based data models and navigation links</title>
      <link>https://docs.microsoft.com/archive/blogs/pedram/ado-net-data-services-clr-based-data-models-and-navigation-links</link>
      <pubDate>Sat, 19 Jul 2008 20:45:00 GMT</pubDate>
      <dc:creator><![CDATA[Pedram Rezaei - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pedram/2008/07/19/ado-net-data-services-clr-based-data-models-and-navigation-links/</guid>
      <description><![CDATA[As you are probably aware, one of the new additions to the .NET Framework 3.5 SP1 is a technology...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>As you are probably aware, one of the new additions to the .NET Framework 3.5 SP1 is a technology called </FONT><A href="http://vs2008sp1docs.msdn.microsoft.com/en-us/ms452029.aspx"><FONT face=Calibri size=3>ADO.NET Data Services</FONT></A><FONT face=Calibri size=3> (code name Astoria). ADO.NET Data Services natively supports </FONT><A href="http://go.microsoft.com/fwlink/?LinkId=105666"><FONT face=Calibri color=#0000ff size=3>ADO.NET Entity Framework</FONT></A><FONT face=Calibri size=3> (EF) models. However Data Services it is not limited to EF. </FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>ADO.NET Data Services can deploy consistent representations of data regardless of the underlying data source. This approach has made CLR-based data models first class citizens. See </FONT><A href="http://vs2008sp1docs.msdn.microsoft.com/en-us/ms452036.aspx"><FONT face=Calibri size=3>here</FONT></A><FONT face=Calibri size=3> for a comprehensive guide on using CRL-based data models.</FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>Imagine the following class diagram that represents two entities:</FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="mso-no-proof: yes; mso-fareast-language: EN-GB"><?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT size=3><FONT face=Calibri><IMG src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/08/75/68/82/astoria1.png" original-url="http://blogs.msdn.com/photos/pedram/images/8756882/original.aspx" mce_src="http://blogs.msdn.com/photos/pedram/images/8756882/original.aspx">&nbsp;</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT size=3><FONT face=Calibri>As you can see, Library has a collection of Books. Therefore </FONT><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt">Library.Books</SPAN><FONT face=Calibri><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt"> </SPAN>can be considered a one-to-many <I style="mso-bidi-font-style: normal">resource navigation link</I> to a collection of Books.</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">public</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">class</SPAN> <SPAN style="COLOR: #2b91af">Library<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">int</SPAN> LibraryID { <SPAN style="COLOR: blue">get</SPAN>; <SPAN style="COLOR: blue">set</SPAN>; }<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">string</SPAN> LibraryName { <SPAN style="COLOR: blue">get</SPAN>; <SPAN style="COLOR: blue">set</SPAN>; }<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: #2b91af">List</SPAN>&lt;<SPAN style="COLOR: #2b91af">Book</SPAN>&gt; Books { <SPAN style="COLOR: blue">get</SPAN>; <SPAN style="COLOR: blue">set</SPAN>; }<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">public</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">class</SPAN> <SPAN style="COLOR: #2b91af">Book<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">int</SPAN> BookID { <SPAN style="COLOR: blue">get</SPAN>; <SPAN style="COLOR: blue">set</SPAN>; }<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">string</SPAN> BookTitle { <SPAN style="COLOR: blue">get</SPAN>; <SPAN style="COLOR: blue">set</SPAN>; }<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>A simple Data Services’ resource container exposing a list of libraries may look similar to the following:</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">public</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">class</SPAN> <SPAN style="COLOR: #2b91af">LibraryDataModel<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: blue">static</SPAN> <SPAN style="COLOR: #2b91af">List</SPAN>&lt;<SPAN style="COLOR: #2b91af">Library</SPAN>&gt; s_libraries = ...;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: #2b91af">IQueryable</SPAN>&lt;<SPAN style="COLOR: #2b91af">Library</SPAN>&gt; Libraries<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">get<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> s_libraries.AsQueryable();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="mso-no-proof: yes">Unfortunatly exploring this data model – by perhaps browsing to the URI that exposes this model – may fail throwing an exception similar to the following:<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><I style="mso-bidi-font-style: normal"><SPAN style="COLOR: #c00000; mso-no-proof: yes">Request Error: The server encountered an error processing the request. The exception message is 'The property 'Books' on type 'AstoriaWeb.Library' is not a valid property. Properties whose types are collection of primitives or complex types are not supported.'<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="mso-no-proof: yes">This means that ADO.NET Data Services was not able to automatically consider Books as a resource set that can be referenced using resource navigation links from Library resources. In fact, without some more information, it is really hard for Data Services to <I style="mso-bidi-font-style: normal">automatically</I> expose a new resource set through a resource container.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="mso-no-proof: yes">So how can you avoid this? For this release of Data Services at least, you need to explicitly expose Books as a resource set in the resource container:<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">public</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">class</SPAN> <SPAN style="COLOR: #2b91af">LibraryDataModel<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: blue">static</SPAN> <SPAN style="COLOR: #2b91af">List</SPAN>&lt;<SPAN style="COLOR: #2b91af">Library</SPAN>&gt; s_libraries = ...;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: blue">static</SPAN> <SPAN style="COLOR: #2b91af">List</SPAN>&lt;<SPAN style="COLOR: #2b91af">Book</SPAN>&gt; s_books = ...;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: #2b91af">IQueryable</SPAN>&lt;<SPAN style="COLOR: #2b91af">Library</SPAN>&gt; Libraries<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">get<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> s_libraries.AsQueryable();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><B style="mso-bidi-font-weight: normal"><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: #2b91af">IQueryable</SPAN>&lt;<SPAN style="COLOR: #2b91af">Book</SPAN>&gt; Books<o:p></o:p></B></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>{<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">get<o:p></o:p></SPAN></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> s_books.AsQueryable();<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>}<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><I style="mso-bidi-font-style: normal"><SPAN style="mso-no-proof: yes">This article was written based on .NET Framework 3.5 SP1 Beta.</SPAN></I></FONT></P>]]></content:encoded>
    </item>
    <item>
      <title>.NET debugging made easier</title>
      <link>https://docs.microsoft.com/archive/blogs/pedram/net-debugging-made-easier</link>
      <pubDate>Sat, 19 Jul 2008 19:34:00 GMT</pubDate>
      <dc:creator><![CDATA[Pedram Rezaei - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pedram/2008/07/19/net-debugging-made-easier/</guid>
      <description><![CDATA[Not sure about you but I was not aware of the existence of the DebuggerStepThroughAttribute....]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>Not sure about you but I was not aware of the existence of the </FONT><A href="http://msdn.microsoft.com/en-us/library/system.diagnostics.debuggerstepthroughattribute.aspx"><FONT face=Calibri size=3>DebuggerStepThroughAttribute</FONT></A><FONT face=Calibri size=3>. Debugging code can be difficult at times and any tool or mechanism that can ease this pain is always welcome.</FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>As far as the CLR is concerned, there is no semantic attached to this attribute. However Visual Studio does not step through methods or classes that are decorated with this attribute. Although you could still use breakpoints in those methods or classes, they are never hit.</FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>And here is how breakpoints would look in Visual Studio 2008:</FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="mso-no-proof: yes; mso-fareast-language: EN-GB"><?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3><IMG src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/pedram/WindowsLiveWriter/f0bba81d00b9.NETdebuggingmadeeasier_5AE/image_thumb.png" original-url="http://blogs.msdn.com/blogfiles/pedram/WindowsLiveWriter/f0bba81d00b9.NETdebuggingmadeeasier_5AE/image_thumb.png" mce_src="http://blogs.msdn.com/blogfiles/pedram/WindowsLiveWriter/f0bba81d00b9.NETdebuggingmadeeasier_5AE/image_thumb.png">&nbsp;</FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>This attribute can be applied to methods, property accessors, classes and structs. I found it to be extremely useful when I wanted to step through a method without first stepping through all property accessors used as parameters or the source instance of the method. In the example below, </FONT><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">a.Value</SPAN><FONT face=Calibri size=3> and </FONT><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">b.Value</SPAN><FONT face=Calibri size=3> are not stepped through when pressing F11 in Visual Studio. It is only the </FONT><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">Add</SPAN><FONT face=Calibri size=3> method that is fully debugged:</FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">var</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> a = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">SomeValue</SPAN>(10);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">var</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> b = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">SomeValue</SPAN>(150);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">...<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">Add(a.Value, a.Value);<BR style="mso-special-character: line-break"><BR><BR style="mso-special-character: line-break"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">class</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: #2b91af">SomeValue<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>...<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">int</SPAN> Value<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>[<SPAN style="COLOR: #2b91af">DebuggerStepThrough</SPAN>]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">get</SPAN> { <SPAN style="COLOR: blue">return</SPAN> value; }<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>Enjoy!</FONT></P>]]></content:encoded>
    </item>
    <item>
      <title>WebChannelFactory inside a WCF Service</title>
      <link>https://docs.microsoft.com/archive/blogs/pedram/webchannelfactory-inside-a-wcf-service</link>
      <pubDate>Sat, 19 Jul 2008 09:32:00 GMT</pubDate>
      <dc:creator><![CDATA[Pedram Rezaei - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/pedram/2008/07/19/webchannelfactory-inside-a-wcf-service/</guid>
      <description><![CDATA[When using a WebChannelFactory inside a WCF service that already has an OperationContext, you may...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>When using a WebChannelFactory inside a WCF service that already has an OperationContext, you may need to </FONT><A href="http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontextscope.aspx"><FONT face=Calibri size=3>create a new context</FONT></A><FONT face=Calibri size=3> before being able to successfully callout using a channel created by the WebChannelFactory. (Notice the line in bold<STRONG>)</STRONG> </FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">public</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"> <SPAN style="COLOR: blue">class</SPAN> <SPAN style="COLOR: #2b91af">RelationService</SPAN> : <SPAN style="COLOR: #2b91af">IRelationService<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: #2b91af">Relation</SPAN>[] GetRelations()<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">var</SPAN> factory = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">WebChannelFactory</SPAN>&lt;<SPAN style="COLOR: #2b91af">ICustomerService</SPAN>&gt;(<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;</SPAN><SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Uri</SPAN>(<SPAN style="COLOR: #a31515">"http://localhost/customerservice/customers.svc"</SPAN>));<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">var</SPAN> proxy = factory.CreateChannel();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">using</SPAN> ((<SPAN style="COLOR: #2b91af">IDisposable</SPAN>)proxy)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><B style="mso-bidi-font-weight: normal"><SPAN style="COLOR: blue">using</SPAN> (<SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">OperationContextScope</SPAN>((<SPAN style="COLOR: #2b91af">IContextChannel</SPAN>)proxy))<o:p></o:p></B></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">var</SPAN> customers = proxy.GetCustomers();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> customers.Select(c =&gt; <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">Relation</SPAN>(c.Name, c.Age)).ToArray();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>In the above example, </FONT><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">GetRelations()</SPAN><FONT face=Calibri size=3> is a RESTful service operation calling into another RESTful service located at the Uri shown above.</FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><IMG src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/08/75/50/13/WebChannelFactory1.png" original-url="http://blogs.msdn.com/photos/pedram/images/8755013/640x92.aspx" mce_src="http://blogs.msdn.com/photos/pedram/images/8755013/640x92.aspx"></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="mso-no-proof: yes; mso-fareast-language: EN-GB"><?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>Without using the new context, you may get an exception similar to the following:</FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><I style="mso-bidi-font-style: normal"><SPAN style="COLOR: #c00000"><FONT size=3><FONT face=Calibri>ProtocolException: The remote server returned an unexpected response: (405) Method Not Allowed.<o:p></o:p></FONT></FONT></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>When investigating further, you may notice that WCF could be using an incorrect HTTP verb for communicating with the service that exposes the </FONT><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">GetCustomers()</SPAN><FONT face=Calibri size=3> operation.</FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>As it happens, here is how </FONT><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">ICustomerService</SPAN><FONT face=Calibri size=3> service contract looks like:</FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">[<SPAN style="COLOR: #2b91af">ServiceContract</SPAN>]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">public</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"> <SPAN style="COLOR: blue">interface</SPAN> <SPAN style="COLOR: #2b91af">ICustomerService<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>[<SPAN style="COLOR: #2b91af">OperationContract</SPAN>]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>[<SPAN style="COLOR: #2b91af">WebGet</SPAN>(<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>UriTemplate = <SPAN style="COLOR: #a31515">"/customers"</SPAN>,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ResponseFormat = <SPAN style="COLOR: #2b91af">WebMessageFormat</SPAN>.Xml,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>BodyStyle = <SPAN style="COLOR: #2b91af">WebMessageBodyStyle</SPAN>.Bare<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>)]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: #2b91af">List</SPAN>&lt;<SPAN style="COLOR: #2b91af">Customer</SPAN>&gt; GetCustomers();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Courier New'">}</SPAN><SPAN style="FONT-FAMILY: Consolas"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>As you can see it is expecting the GET verb. Without creating a new context, WCF ends up using the POST verb which will eventually cause the above exception.</FONT></P>]]></content:encoded>
    </item>
  </channel>
</rss>