<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.syrinx.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>Syrinx Consulting</title><link>http://blogs.syrinx.com/blogs/</link><description>Notes from the field on SharePoint development, deployment and usage.</description><dc:language>en-US</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>MOSS Search Part 3 - Authoritative Pages</title><link>http://blogs.syrinx.com/blogs/sharepoint/archive/2008/08/22/moss-search-part-3-authoritative-pages.aspx</link><pubDate>Fri, 22 Aug 2008 20:21:43 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:159</guid><dc:creator>AndreyL</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;In this part of the series we will take a look at setting up authoritative pages, which allows influencing the order of results coming from different content sources. You can specify which pages have higher or lower priority when appearing in the search results by providing a rank for pages or sites. &lt;/p&gt; &lt;p&gt;To add a site/page to Authoritative (or non-authoritative - demoted) pages:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Go to Sharepoint Administration Site and click on the link under &amp;quot;Shared Services Administration&amp;quot; in the &amp;quot;Quick Launch&amp;quot; panel to open the Shared Services web site. &lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSSearchPart3AuthoritativePages_D817/image_2.png"&gt;&lt;img style="border-top-width:0px;display:block;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="220" alt="image" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSSearchPart3AuthoritativePages_D817/image_thumb.png" width="154" border="0" /&gt;&lt;/a&gt;  &lt;li&gt;Open the Search Settings page by clicking on the Search Settings link in the Search section of Shared Services site  &lt;li&gt;In the Authoritative Pages section follow the Specify Authoritative Pages link &lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSSearchPart3AuthoritativePages_D817/image_4.png"&gt;&lt;img style="border-top-width:0px;display:block;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="134" alt="image" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSSearchPart3AuthoritativePages_D817/image_thumb_1.png" width="244" border="0" /&gt;&lt;/a&gt;  &lt;li&gt;Fill out the Specify Authoritative Pages form providing the URL&amp;#39;s for sites/pages having most and least influence on the order of search results.&lt;/li&gt; &lt;ol&gt; &lt;li&gt;Most Authoritative sites: &lt;a href="http://mysite.com/most_important_site"&gt;http://mysite.com/most_important_site&lt;/a&gt; &lt;li&gt;Least Authoritative sites: &lt;a href="http://mysite.com/dont_care_about_search.aspx"&gt;http://mysite.com/dont_care_about_search.aspx&lt;/a&gt;&amp;nbsp; &lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Press &amp;quot;Ok&amp;quot; to save results.&lt;/li&gt;&lt;/ol&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=159" width="1" height="1"&gt;</description></item><item><title>Running code inside MOSS with elevated permissions</title><link>http://blogs.syrinx.com/blogs/sharepoint/archive/2008/08/11/running-code-inside-moss-with-elevated-permissions.aspx</link><pubDate>Mon, 11 Aug 2008 15:45:30 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:158</guid><dc:creator>AndreyL</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Last week I was working on a simple web part that&amp;nbsp; would get come data from an MS SQL database and show in a grid. Per client&amp;#39;s infrastructure requirements the connection to the sql server might only be done using integrated security, as sql users are not allowed to be created/used. By default, if you specify &amp;quot;Trusted_Connection = true&amp;quot;, one of three things would happen: if the user is accessing the web site locally (the same server the MOSS WFE is running), her credentials will be used to connect to the SQL server; if the user is accessing the web site from the remote computer then depending on whether KerberOS authentication is turned on on the network either the user credentials or NT AUTHORITY/ANONIMOUS USER will be used for connection. Neither would not work in our case as the network team refused to enable KerberOS; after some research and with a hint from our inhouse MOSS guru Ryan Thomas I found that MOSS API gives you a way of executing a piece of code as the user running MOSS application pool; the way of doing it is in fact as easy as invoking a delegate;&lt;/p&gt; &lt;p&gt;you need to pass a delegate to a method containing your code to&amp;nbsp; SPSecurity.RunWithElevatedPrivileges() method; it&amp;#39;s even easier when using anonymous delegates feature of C# 2.0:&lt;/p&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt; &lt;p&gt;SPSecurity&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.RunWithElevatedPrivileges(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;SPSecurity&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;CodeToRunElevated&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;delegate&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;()&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;{&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font size="2"&gt;... your code to connect to SQL server ...&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font size="2"&gt;}));&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;And all you have left to do is to configure appropriate permissions for the App Pool user on the SQL server.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=158" width="1" height="1"&gt;</description><category domain="http://blogs.syrinx.com/blogs/sharepoint/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category></item><item><title>CAML query to select items assigned to current user.</title><link>http://blogs.syrinx.com/blogs/sharepoint/archive/2008/08/07/caml-query-to-select-items-assigned-to-current-user.aspx</link><pubDate>Fri, 08 Aug 2008 00:08:00 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:157</guid><dc:creator>IanD</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;So after much googling and trying all the suggestions at &lt;/p&gt;
&lt;p&gt;&lt;a href="http://forums.msdn.microsoft.com/en-US/sharepointworkflow/thread/e8891d49-1d82-422e-8c7f-eb99326ec14c"&gt;http://forums.msdn.microsoft.com/en-US/sharepointworkflow/thread/e8891d49-1d82-422e-8c7f-eb99326ec14c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We found the way to select from a list where the Assigned To user is the current user by building a view that has a filter criteria of Assigned To = [Me]. From this we got a reference to the SPView object for that view and then looked at the .Query specified:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Our resulting code:&lt;/p&gt;
&lt;p&gt;SPQuery qry;&lt;br /&gt;qry.Query = &amp;quot;&amp;lt;Where&amp;gt;&amp;lt;Eq&amp;gt;&amp;lt;FieldRef Name=\&amp;quot;AssignedTo\&amp;quot; /&amp;gt;&amp;lt;Value Type=\&amp;quot;Integer\&amp;quot;&amp;gt;&amp;lt;UserID Type=\&amp;quot;Integer\&amp;quot; /&amp;gt;&amp;lt;/Value&amp;gt;&amp;lt;/Eq&amp;gt;&amp;lt;/Where&amp;gt;&amp;quot;;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps someone else save the hours we spent.&lt;/p&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=157" width="1" height="1"&gt;</description><category domain="http://blogs.syrinx.com/blogs/sharepoint/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.syrinx.com/blogs/sharepoint/archive/tags/WSS/default.aspx">WSS</category><category domain="http://blogs.syrinx.com/blogs/sharepoint/archive/tags/CAML/default.aspx">CAML</category><category domain="http://blogs.syrinx.com/blogs/sharepoint/archive/tags/Assigned+To/default.aspx">Assigned To</category></item><item><title>CAML queries with dates</title><link>http://blogs.syrinx.com/blogs/sharepoint/archive/2008/08/05/caml-queries-with-dates.aspx</link><pubDate>Tue, 05 Aug 2008 20:06:32 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:156</guid><dc:creator>AndreyL</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Recently I was working on a utility that would query a MOSS list for items with update_timestamp field within a certain range. I used CAML queries for the task and this is when I found out that for dates in CAML&amp;nbsp; query filter the time part gets omitted, i.e. following two CAML queries will return the same results even though time part of the date is different:&lt;/p&gt; &lt;p&gt;&lt;code&gt;&lt;font color="#008080"&gt;&amp;lt;Query&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Where&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Geq&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;FieldRef Name=&amp;#39;Update_Timestamp&amp;#39; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Value Type=&amp;#39;DateTime&amp;#39;&amp;gt;2008-07-14T&lt;strong&gt;00:00:00&lt;/strong&gt;Z&amp;lt;/Value&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Geq&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Where&amp;gt;&lt;br /&gt;&amp;lt;/Query&amp;gt;&lt;/font&gt;&lt;/code&gt;&lt;/p&gt; &lt;p&gt;-----&amp;nbsp; and ----&lt;/p&gt; &lt;p&gt;&lt;code&gt;&lt;font color="#008080"&gt;&amp;lt;Query&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Where&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Geq&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;FieldRef Name=&amp;#39;Update_Timestamp&amp;#39; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Value Type=&amp;#39;DateTime&amp;#39;&amp;gt;2008-07-14T&lt;strong&gt;08:31:00Z&lt;/strong&gt;&amp;lt;/Value&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Geq&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Where&amp;gt;&lt;br /&gt;&amp;lt;/Query&amp;gt;&lt;/font&gt;&lt;/code&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;After some googling I found that the solution for this problem is to add &amp;quot;IncludeTimeValue&amp;quot; argument: &lt;/p&gt; &lt;p&gt;&lt;code&gt;&lt;font color="#008080"&gt;&amp;lt;Value Type=&amp;#39;DateTime&amp;#39; &lt;strong&gt;IncludeTimeValue=&amp;#39;TRUE&amp;#39;&lt;/strong&gt; &amp;gt;2008-07-14T08:31:00Z&amp;lt;/Value&amp;gt;&lt;/font&gt;&lt;/code&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Another problem I have been facing is how to include a dynamic date filter that is evaluated at runtime instead of hardcoding the dates, e.g. I want to include items with update_timestamp 5 days back or newer, something like Today() - 5. As I discovered, there is a CAML operator that does just that:&lt;/p&gt; &lt;p&gt;Instead of specifying a date you can do following:&lt;/p&gt;&lt;code&gt;&lt;font color="#008080"&gt; &lt;p&gt;&amp;lt;Query&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Where&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Geq&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;FieldRef Name=&amp;quot;&lt;font face="Courier New" size="2"&gt;Update_Timestamp&lt;/font&gt;&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Value Type=&amp;quot;DateTime&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&amp;lt;Today OffsetDays=&amp;quot;-5&amp;quot; /&amp;gt;&lt;br /&gt;&lt;/strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Value&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Geq&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Where&amp;gt;&lt;br /&gt;&amp;lt;/Query&amp;gt; &lt;/p&gt;&lt;/font&gt;&lt;/code&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;And a closing tip: to create a sharepoint-formatted date string from a DateTime object you can use &lt;code&gt;&lt;font color="#008080"&gt;SPUtility.CreateISO8601DateTimeFromSystemDateTime()&lt;/font&gt;&lt;/code&gt; method.&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=156" width="1" height="1"&gt;</description><category domain="http://blogs.syrinx.com/blogs/sharepoint/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.syrinx.com/blogs/sharepoint/archive/tags/CAML/default.aspx">CAML</category></item><item><title>Converting Strongly Typed Collections to Generics: Part 2</title><link>http://blogs.syrinx.com/blogs/dotnet/archive/2008/07/02/converting-strongly-typed-collections-to-generics-part-2.aspx</link><pubDate>Thu, 03 Jul 2008 02:39:00 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:152</guid><dc:creator>GreggV</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;In Part 1, the idea of converting your strongly typed collections to Generics was introduced.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Backward compatibility and existing client support was maintained.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;However once a level of acceptance has been maintained for the new base class and the reduced amount of code in the collection classes, new development can utilize new constructs in c#3.0 which can reduce the code in your strongly typed collections even more, as well as eliminating the strongly typed collections all together.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;See the code snippet below which shows the base generic class.&lt;/span&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;
&lt;p&gt;public class BaseGenericCollection&amp;lt;T&amp;gt; : System.Collections.ObjectModel.Collection&amp;lt;T&amp;gt;&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal List&amp;lt;T&amp;gt; m_deletedList = null;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new public void Add(T t)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (this.Contains(t))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new System.ArgumentException(&amp;quot;Cannot add duplicate entry to collection.&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base.Add(t);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Delete(T t)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (t == null)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp;throw new ArgumentNullException(&amp;quot;T&amp;quot;, &amp;quot;BaseGenericCollection: Cannot Delete NULL from collection.&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (m_deletedList == null)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_deletedList = new List&amp;lt;T&amp;gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.m_deletedList.Add(t);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base.Remove(t);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;The base class now no longer needs the &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;GenericSorter&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;&amp;lt;T&amp;gt; &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;internal class it had in Part 1.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;The strongly typed &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;StudentCollection &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;is also no longer needed, but can be kept around for backward compatibility.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;However the same functionality can still be achieved, along with type safety, using anonymous methods, or even cleaner syntax with lambda expressions.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;Lambda expressions simplify the syntax of defining at run time, logic that can be invoked in response to an event without needing a dedicated method for the event handler.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;Consider the following code which illustrates using lambda expressions to sort a collection that has a new base class.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;static void Main(string[] args)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Load up a Generic collection of Student objects&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BaseGenericCollection&amp;lt;Student&amp;gt; _students = LoadStudents();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Notice that the Students can be ordered within the loop using the OrderBy method from the extension&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //methods from System.Linq within CollectionBase&amp;lt;T&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //and the syntax can be reduced using the Lamda operator instead of an anonymous&amp;nbsp; method&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var student in _students.OrderBy(student =&amp;gt; student.Major))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(&amp;quot;{0,-10} \t{1,-10} \t{2,-10} \t{3,-10:d} \t{4,-10:D} &amp;quot;, &lt;br /&gt;&amp;nbsp;&amp;nbsp; student.FirstName, student.LastName, student.Major, &lt;br /&gt;&amp;nbsp;&amp;nbsp; student.EnrollmentDate, student.GraduationDate);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;
&lt;p&gt;&lt;br /&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;The local student collection instance,&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;_students&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;,&lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt; is now a &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;BaseGenericCollection&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;&amp;lt;&lt;span style="COLOR:#2b91af;"&gt;Student&lt;/span&gt;&amp;gt; &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;type and still has all the capabilities it had previously but with less code.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;The base class’ base class &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;System.Collections.ObjectModel.&lt;span style="COLOR:#2b91af;"&gt;Collection&lt;/span&gt;&amp;lt;T&amp;gt; &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;has an extension method in &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;System.Linq&lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt; for sorting called &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;OrderBy&lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt; that requires to be passed a delegate, which can be replaced with a lambda expression.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;
&lt;h2 style="MARGIN:10pt 0in 0pt;"&gt;&lt;font face="Cambria" color="#4f81bd" size="4"&gt;New Constructs&lt;/font&gt;&lt;/h2&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;C# 3.0 supports the capability of handling events inline by assigning or delegating a chunk of code directly where an event handler will be referenced, instead of creating a dedicated method to respond to an event.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;This approach takes advantage of anonymous methods.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;The syntax can be a little “too busy” or confusing.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;The syntax can be cleaned up using lambda expressions, which are cleaner, more simply ways of creating anonymous methods.&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:7.5pt 0in 3.75pt;"&gt;The MSDN Library defines a lambda expression as “&lt;span style="FONT-SIZE:8.5pt;COLOR:black;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;… an anonymous function that can contain expressions and statements, and can be used to create delegates or expression tree types.&lt;/span&gt;”&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;The syntax can be broken down as: &lt;i style="mso-bidi-font-style:normal;"&gt;arguments to be processed =&amp;gt; (goes to) statements to be processed&lt;/i&gt;.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;In the example above, the &lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;OrderBy&lt;/span&gt; method is passed a &lt;i style="mso-bidi-font-style:normal;"&gt;student&lt;/i&gt; instance (to be evaluated once it is referenced via the &lt;span style="FONT-SIZE:10pt;COLOR:blue;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;foreach&lt;/span&gt; loop) which is the object to be processed, then the “goes to” operator (=&amp;gt;)and &lt;i style="mso-bidi-font-style:normal;"&gt;student.Major&lt;/i&gt;, ( the value of the student’s major), which is the statement that is to be processed.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;The &lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;OrderBy&lt;/span&gt; method actually considers it like an identity function according to the MSDN Library.&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;To illustrate lambda expression or more so, the &lt;i style="mso-bidi-font-style:normal;"&gt;statements to be processed&lt;/i&gt; consider the following example.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;//First define the major we are looking for&lt;br /&gt;Program._majorToFind = &amp;quot;Physics&amp;quot;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;//Now we can loop thru the collection that is returned from casting to a List&amp;lt;Student&amp;gt; collection and using the FindAll method, using the Lambda operator&lt;br /&gt;foreach (var student in _students.ToList&amp;lt;Student&amp;gt;().FindAll&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (student =&amp;gt; student.Major == Program._majorToFind))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(&amp;quot;{0,-10} \t{1,-10} \t{2,-10} \t{3,-10:d} \t{4,-10:D} &amp;quot;, student.FirstName, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; student.LastName, student.Major, student.EnrollmentDate, student.GraduationDate);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;//Now we utilize the Find method, to find a specific instance with specific data, using the Lambda operator &lt;br /&gt;Program._lastNameToFind = &amp;quot;Valenti&amp;quot;;&lt;br /&gt;Student students = _students.ToList&amp;lt;Student&amp;gt;().Find(student =&amp;gt; student.LastName == Program._lastNameToFind);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;span style="FONT-SIZE:8pt;COLOR:green;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;font face="Calibri" color="#000000"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;span style="FONT-SIZE:8pt;COLOR:green;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;font face="Calibri" color="#000000"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;Notice the &lt;span style="FONT-SIZE:10pt;COLOR:blue;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;foreach&lt;/span&gt;, the type that is being retrieved is defined as a &lt;span style="FONT-SIZE:10pt;COLOR:blue;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;var&lt;/span&gt; which is an anonymous type that is ultimately returned from the &lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;Find&lt;/span&gt; and &lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;FindAll&lt;/span&gt; methods of &lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;List&amp;lt;&lt;span style="COLOR:#2b91af;"&gt;T&lt;/span&gt;&amp;gt;&lt;/span&gt;.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Those methods expect to receive a &lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;System.&lt;span style="COLOR:#2b91af;"&gt;Predicate&lt;/span&gt;&amp;lt;T&amp;gt;&lt;/span&gt;, which is ultimately a delegate or method pointer.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;As illustrated above, a method pointer can be replaced by an anonymous method which also can be replaced by a lambda expression.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;The &lt;i style="mso-bidi-font-style:normal;"&gt;statements to be processed&lt;/i&gt; in the lambda expression are looking for &lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;student &lt;/span&gt;instances with a student &lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;Major&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt; &lt;/span&gt;property value of “Physics” and only return instances with those values.&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;The same is true for the &lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;Find&lt;/span&gt; method of &lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;List&amp;lt;&lt;span style="COLOR:#2b91af;"&gt;T&lt;/span&gt;&amp;gt;&lt;/span&gt;.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;It requires a method pointer which can be replaced with a lambda expression that returns the student object with the &lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;LastName&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt; &lt;/span&gt;property equal to &lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;Program&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;._lastNameToFind&lt;/span&gt;.&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;Your strongly typed collection code can be further reduced than that illustrated in Part 1, by utilizing new constructs added to the c# language.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;These new objects and constructs actually make it more readable and understandable once you understand how they are read.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;All the compiler time type checking is maintained and the compiler infers the correct type for the anonymous types used in the lambda expressions.&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;In Part 3, the lambda expression will be replaced with Language Integrated Queries (Linq).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;/span&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=152" width="1" height="1"&gt;</description><enclosure url="http://blogs.syrinx.com/blogs/dotnet/attachment/152.ashx" length="5630" type="application/x-zip-compressed" /><category domain="http://blogs.syrinx.com/blogs/dotnet/archive/tags/.Net+Generics+Collections+anonymous+methods/default.aspx">.Net Generics Collections anonymous methods</category></item><item><title>Betting on SharePoint</title><link>http://blogs.syrinx.com/blogs/sharepoint/archive/2008/06/23/betting-on-sharepoint.aspx</link><pubDate>Tue, 24 Jun 2008 00:27:29 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:148</guid><dc:creator>RyanT</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Last month Andrew Gelina (Syrinx&amp;#39;s CEO) and myself had a nice conversation with Gayle Rodcay of Windows IT Pro magazine.&amp;nbsp; She asked a lot of great questions about the top features/functionality we have seen requested in the SharePoint space.&amp;nbsp; Her write-up of the interview went online and is available for everyone at:&amp;nbsp; &lt;/p&gt; &lt;p&gt;&lt;a title="http://windowsitpro.com/article/articleid/99317/betting-on-sharepoint.html" href="http://windowsitpro.com/article/articleid/99317/betting-on-sharepoint.html"&gt;http://windowsitpro.com/article/articleid/99317/betting-on-sharepoint.html&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Let me know what you think!&lt;/p&gt; &lt;p&gt;-Ryan&lt;/p&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=148" width="1" height="1"&gt;</description></item><item><title>Buried Treasure: Uncovering SharePoint's Riches</title><link>http://blogs.syrinx.com/blogs/sharepoint/archive/2008/06/23/buried-treasure-uncovering-sharepoint-s-riches.aspx</link><pubDate>Tue, 24 Jun 2008 00:23:54 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:147</guid><dc:creator>RyanT</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I just wanted to pass along a recent article I wrote for Redmond Channel Partner magazine for the May issue.&amp;nbsp; They wanted the article written to help the community with the common problem many users of SharePoint are faced with:&amp;nbsp; What do I do with it?&amp;nbsp; How can it help my company?&amp;nbsp; &lt;/p&gt; &lt;p&gt;The full article can be found here:&amp;nbsp; &lt;/p&gt; &lt;p&gt;&lt;a title="http://rcpmag.com/columns/article.aspx?editorialsid=2584" href="http://rcpmag.com/columns/article.aspx?editorialsid=2584"&gt;http://rcpmag.com/columns/article.aspx?editorialsid=2584&lt;/a&gt;&lt;/p&gt; &lt;p&gt;-Ryan&lt;/p&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=147" width="1" height="1"&gt;</description></item><item><title>Tech-Ed 2008 Wrap-up</title><link>http://blogs.syrinx.com/blogs/sharepoint/archive/2008/06/10/tech-ed-2008-wrap-up.aspx</link><pubDate>Tue, 10 Jun 2008 12:16:33 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:145</guid><dc:creator>RyanT</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I got back home to Boston after having a great week at Tech-Ed.&amp;nbsp; It really was a good show.&amp;nbsp; I met a lot of new people as well as catch up with some friends in the industry.&amp;nbsp; There really was a lot of great content and dialogue around SharePoint to help all of us in our quest to keep learning more and more to help our clients get the best possible results.&amp;nbsp; Thanks again to Tom Robbins, Chris Bowen, and Bob Familiar from Microsoft for taking us to dinner, introducing us to some great people, and really going the extra mile.&lt;/p&gt; &lt;p&gt;I learned about a couple tools used by the presenters to make our lives easier and wanted to pass those along to everyone:&amp;nbsp; &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.ultrapico.com/Expresso.htm"&gt;Expresso&lt;/a&gt;: A regular expression builder was very interesting and will come in handy when the federated search components are added to MOSS very soon.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.fiddlertool.com/fiddler/"&gt;Fiddler&lt;/a&gt;: A http traffic sniffer to help you look at the breakdown of items loading on your pages.&amp;nbsp; Thank you to &lt;a href="http://www.andrewconnell.com/blog/"&gt;Andrew Connell&lt;/a&gt; for showing this off.&amp;nbsp; It was eye-opening to say the least watching him run this tool on a SharePoint page.&lt;/p&gt; &lt;p&gt;Speaking of &lt;a href="http://www.andrewconnell.com/blog/"&gt;Andrew Connell&lt;/a&gt;, I just wanted to point out what a great session he did on the last day about building your SharePoint applications with performance in mind.&amp;nbsp; Not only was the content excellent, but as usual, his presentation style was engaging and interesting.&lt;/p&gt; &lt;p&gt;I hope to see everyone again next year,&lt;/p&gt; &lt;p&gt;-Ryan&lt;/p&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=145" width="1" height="1"&gt;</description></item><item><title>Tech-Ed Day Two</title><link>http://blogs.syrinx.com/blogs/sharepoint/archive/2008/06/05/tech-ed-day-two.aspx</link><pubDate>Thu, 05 Jun 2008 20:21:43 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:142</guid><dc:creator>RyanT</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Day two was better than the first day in terms of session content and interest, at least from my perspective.&amp;nbsp; I took pictures, but decided it was better to get the post up than get the pictures ready.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;XMOL / XAML&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.johnholliday.net/"&gt;John Holliday&lt;/a&gt; gave an in-depth coding example about how you can build your own XOML/XAML editor that sits between Visual Studio and SharePoint Designer, allowing you load, modify, and build custom Workflows.&amp;nbsp; Although I&amp;#39;m not sure I&amp;#39;d ever use such a tool, the exercise in seeing it built and operate shed even more light on WF.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Federated Search in MOSS 2007&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Michal Gideoni from Microsoft presented a session on the new abilities of SharePoint for Search 2008 and therefore the new patch being release within a month that will add these features to existing MOSS implementations.&amp;nbsp; &lt;/p&gt; &lt;p&gt;She demonstrated some very powerful and easy methods to build federated search web parts that basically connect to anything!&amp;nbsp; Ok, maybe not anything, but just about anything that you can call via code to search and return data.&amp;nbsp; Her solution was to convert almost any foreign search component&amp;#39;s return data into an RSS format so the local federated web parts can use this for display purposes.&amp;nbsp; This included Google, SQL Server, Mapping tools, etc.&amp;nbsp; With some clever regular expression manipulation she was able to allow for custom search queries to look for specific items that certain searches are more qualified to return.&lt;/p&gt; &lt;p&gt;Finally, Michal mentioned that some new protocols for Documentum and FileNet have been released for MOSS to search and index the content.&amp;nbsp; She also informed us that the new federated search web parts are no longer sealed, thus allowing us to inherit from them and begin extending their functionality.&amp;nbsp; I sure hope Microsoft follows suit on this new direction with their other web parts as well!&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Making SharePoint Development Better&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.sharepointblogs.com/stacydraper/default.aspx"&gt;Stacy Draper&lt;/a&gt; hosted a really great Birds of a Feather session for SharePoint developers.&amp;nbsp; Essentially it was an open forum for those of us working in this genre to ask questions, express ideas, discuss current issues, offer solutions to problems, and generally hear about how other people are doing.&amp;nbsp; It was very informative and good to hear that a lot of people experience the same issues in these environments.&amp;nbsp; We met some talented developers genuinely there to learn, collaborate, and share knowledge.&amp;nbsp; Thanks again Stacy!&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Content Types for Document Management&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Another session by &lt;a href="http://www.johnholliday.net/"&gt;John Holliday&lt;/a&gt;.&amp;nbsp; I seem gravitate towards the types of sessions he covers.&amp;nbsp; This session was a deep-dive coding example about creating Content Types in code and how you can use reflection to make this process much easier.&amp;nbsp; His session is probably the &amp;quot;deepest&amp;quot; I&amp;#39;ve seen someone get into when it comes to Content Types via the object model.&amp;nbsp; &lt;/p&gt; &lt;p&gt;One thing he mentioned that I hadn&amp;#39;t thought of before is the ability to send documents with any/all Content Types into a more generic rules engine if you choose to validate documents/items entering your applications.&amp;nbsp; Right now, you can attach Information Management Policies or Workflows to Content Types, or you can write custom code that can look at Content Types on various events (adding, updating, etc) to validate, but each of these methods is fairly specific to a certain type of document, Content Typde or validation rule.&amp;nbsp; I liked the idea of building these validators that could apply to all Content Types, but your code is essentially a rules engine that looks at all the metadata for each Content Type, along with other conditions, to determine certain allowable actions during certain events.&amp;nbsp; You could get clever with this approach and build a nice front-end for your rules data.&amp;nbsp; &lt;/p&gt; &lt;p&gt;That&amp;#39;s it for day 2!&lt;/p&gt; &lt;p&gt;-Ryan&lt;/p&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=142" width="1" height="1"&gt;</description></item><item><title>Warming Up SharePoint Servers After Cold Restart</title><link>http://blogs.syrinx.com/blogs/sharepoint/archive/2008/06/04/warming-up-sharepoint-servers-after-cold-restart.aspx</link><pubDate>Thu, 05 Jun 2008 03:20:45 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:141</guid><dc:creator>AndreyL</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Everyone knows how painful it is to try reaching a MOSS page after an IIS reset or a server reboot; what happens is ASP.NET performing page and resource compilation and caching. You can help your users save frustration by simply touching every MOSS web application once after a cold restart. Of course you would prefer to automate such a task instead of firing up a browser every time your server restarts. Isn&amp;#39;t it easier to click on an icon on your desktop and warm-up all those 20 SharePoint servers at once? &lt;/p&gt; &lt;p&gt;To create a warm up script we can use Microsoft&amp;#39;s own XMLHTTP object from XML DOM suit and Windows Scripting. The simplest VB script to touch a web page would look like:&lt;/p&gt; &lt;p&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;#39; Check if a site url specified&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; wscript.Arguments.Count &amp;lt;&amp;gt; 1 &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Then&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;br /&gt;wscript.Echo &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Please specify a url!&amp;quot;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;wscript.Quit&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;end&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;If&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;br /&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; xmlHttp&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Set&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; xmlHttp = CreateObject(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Msxml2.ServerXMLHTTP.3.0&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;If&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Err.Number &amp;lt;&amp;gt; 0 &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Then&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Set&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; xmlHttp = CreateObject(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Microsoft.XMLHTTP&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;) &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;If&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Err.Number &amp;lt;&amp;gt; 0 &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Then&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; wscript.Quit &lt;br /&gt;wscript.Echo &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Touching &amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &amp;amp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;CStr&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(wscript.Arguments(0))&lt;br /&gt;xmlHttp.Open &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;GET&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;CStr&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(wscript.Arguments(0)), &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;False&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;xmlHttp.Send&lt;br /&gt;&lt;/p&gt;&lt;/font&gt; &lt;p&gt;And you can call this script from a batch file using wscript.exe or cscript.exe tools which run the script in the Windows script Host:&lt;/p&gt; &lt;p&gt;wscript c:\warmup.vbs &amp;quot;&lt;a href="http://moss.com/site"&gt;http://moss.com/site&lt;/a&gt;&amp;quot;&lt;/p&gt; &lt;p&gt;So just add such a command for all your moss sites to a batch file and run after each cold restart.&lt;/p&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=141" width="1" height="1"&gt;</description></item><item><title>Tech-Ed Day One</title><link>http://blogs.syrinx.com/blogs/sharepoint/archive/2008/06/04/tech-ed-day-one.aspx</link><pubDate>Wed, 04 Jun 2008 22:47:59 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:139</guid><dc:creator>RyanT</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;I just wanted to do a quick write-up from day one at Tech-Ed 2008 Developer in Orlando Florida.&amp;nbsp; The opening Keynote address by Bill Gates was very good.&amp;nbsp; He touched upon his upcoming departure about Microsoft, but not without also leaving us with a nice picture of where he feels the technology of Microsoft is heading.&amp;nbsp; The big pieces were the demonstrations about presentation with the upcoming release of SilverLight 2 Beta 2, development and middle-tier efforts with Visual Studio 2008; including some of the interesting architecture, diagram, and pattern enforcement tools.&amp;nbsp; He ended with discussing and demonstrating the back-end with SQL Server 2008&amp;#39;s ability to do spatial queries and the addition of more platform services.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/TechEdDayOne_103AC/BillTechEd_2.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="224" alt="BillTechEd" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/TechEdDayOne_103AC/BillTechEd_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Visual Studio 2008 Development for SharePoint&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;I also attended some interesting sessions around SharePoint technologies.&amp;nbsp; There will be a 1.2 release of Visual Studio extensions for Windows SharePoint Services very soon that will support Visual Studio 2008.&amp;nbsp; There will be no added functionality to the extensions, but this is still a useful milestone for moving forward with some of the new development tools.&amp;nbsp; Thank you to&amp;nbsp; Paul Andrew for giving us a walk-through.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SQL Server Reporting Services and SharePoint&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;There was a very interesting session by Prash Shirolkar on the some of the great integration features between SSRS (SQL Server Reporting Services) and MOSS.&amp;nbsp; He demonstrated some great examples of SSRS reporting on information in the WSS Content Databases, building and publishing reports from SSRS to SharePoint libraries, and some of the new Web Parts available to view very comprehensive reports within SharePoint.&amp;nbsp; He also gave a quick overview on an SSRS report, running in a Web Part, that was able write data back to a local SharePoint list.&amp;nbsp; Interesting stuff!&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/TechEdDayOne_103AC/sessionssrs_4.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="140" alt="sessionssrs" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/TechEdDayOne_103AC/sessionssrs_thumb_1.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/TechEdDayOne_103AC/Untitled%20picture_2.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="141" alt="Untitled picture" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/TechEdDayOne_103AC/Untitled%20picture_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Custom Routers in SharePoint Records Center&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;John Holliday gave a nice overview in a smaller, informal venue about building custom routers in Records Center.&amp;nbsp; Building these routers is actually fairly straightforward, and there seems to be some value to this in the ability to have more granular control via code over the filtering, authenticating, and management of documents that enter your repository.&amp;nbsp; Andrew Connell was sitting on the session and a very thought-provoking conversation sparked up about backing up / managing / viewing snapshots of content managed publishing sites in SharePoint.&amp;nbsp; It seems like we&amp;#39;ve all been getting requests for this type of management and control over SharePoint lately.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/TechEdDayOne_103AC/Untitled%20picture2_2.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="120" alt="Untitled picture2" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/TechEdDayOne_103AC/Untitled%20picture2_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Overall it&amp;#39;s been a great time and has been a lot of fun talking to like-minded people working on SharePoint in the industry!&amp;nbsp; More to come...&lt;/p&gt; &lt;p&gt;-Ryan&lt;/p&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=139" width="1" height="1"&gt;</description></item><item><title>MOSS Enterprise Search. Addition to Part 1</title><link>http://blogs.syrinx.com/blogs/sharepoint/archive/2008/05/31/moss-enterprise-search-addition-to-part-1.aspx</link><pubDate>Sat, 31 May 2008 16:19:12 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:138</guid><dc:creator>AndreyL</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;In the first part of the series we&amp;#39;ve looked at how to create content sources to be crawled. In addition to that, you can control the behavior of the crawler on the content sources by setting exclusion and inclusion rules on the content. Those rules apply to all and any content matched by specified URL patterns. Let&amp;#39;s take an example: you don&amp;#39;t want the indexer to index anything under&amp;nbsp; &lt;a href="http://yourserver.com/sites/"&gt;http://yourserver.com/sites/&lt;/a&gt; with one exception: you want to index one particular subsite: &lt;a href="http://yourserver.com/sites/yourblogs"&gt;http://yourserver.com/sites/yourblogs&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;First, you need to set an exclusion rule:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Open Shared Services web site:  &lt;ul&gt; &lt;li&gt;Open &lt;strong&gt;Sharepoint 3.0 Central Administration&lt;/strong&gt; web site  &lt;li&gt;Under &lt;strong&gt;Shared Services Administration&lt;/strong&gt; section on the left side navigation, click on the Shared Services link to load Shared Services web site &lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.AdditiontoPart1_A438/image_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="218" alt="image" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.AdditiontoPart1_A438/image_thumb.png" width="154" border="0" /&gt;&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt; &lt;li&gt;In the &lt;strong&gt;Search&lt;/strong&gt; section click on &lt;strong&gt;Search Settings&lt;/strong&gt; link: &lt;br /&gt;&lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.AdditiontoPart1_A438/image_4.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="90" alt="image" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.AdditiontoPart1_A438/image_thumb_1.png" width="170" border="0" /&gt;&lt;/a&gt;  &lt;li&gt;In &lt;strong&gt;Crawl Settings&lt;/strong&gt; section click on &lt;strong&gt;Crawl Rules&lt;/strong&gt; link  &lt;li&gt;Now we will create an exclusion rule to exclude all sites and content under &lt;a href="http://yourserver.com/sites/"&gt;http://yourserver.com/sites/&lt;/a&gt; from being indexed:  &lt;ol&gt; &lt;li&gt;Click the &lt;strong&gt;New Crawl Rule&lt;/strong&gt; button &lt;br /&gt;&lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.AdditiontoPart1_A438/image_6.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="86" alt="image" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.AdditiontoPart1_A438/image_thumb_2.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;br /&gt;to enter the &lt;strong&gt;Add crawl Rule&lt;/strong&gt; wizard: &lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.AdditiontoPart1_A438/image_8.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="246" alt="image" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.AdditiontoPart1_A438/image_thumb_3.png" width="404" border="0" /&gt;&lt;/a&gt;  &lt;li&gt;In the Path box enter the URL filter: &lt;a href="http://yourserver.com/sites/"&gt;http://yourserver.com/sites/*&lt;/a&gt;, then click Ok button to save the rule.&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Next we create an inclusion rule that will allow content of some sites excluded in the previous step to be indexed: as in the previous step, click the &lt;strong&gt;New Crawl Rule&lt;/strong&gt; button, the in the Path text box enter the URL pattern to be included: &lt;a href="http://yourserver.com/sites/yourblogs/"&gt;http://yourserver.com/sites/yourblogs/&lt;/a&gt;*, and select &lt;strong&gt;Include all items in this path&lt;/strong&gt; option in the &lt;strong&gt;Crawl Configuration&lt;/strong&gt; section, then click Ok to apply the rule. &lt;/li&gt;&lt;/ol&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=138" width="1" height="1"&gt;</description></item><item><title>Converting Strongly Typed Collections to Generics: Part 1</title><link>http://blogs.syrinx.com/blogs/dotnet/archive/2008/05/28/converting-strongly-typed-collections-to-generics-part-1.aspx</link><pubDate>Thu, 29 May 2008 01:44:00 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:137</guid><dc:creator>GreggV</dc:creator><slash:comments>0</slash:comments><description>&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;TEXT-ALIGN:justify;"&gt;&lt;font face="Calibri" size="3"&gt;Many enterprise applications make use of strongly typed collections in their solution.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Although they require more development time, the advantages they provide can outweigh the cost of the extra development time.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Some of the advantages include compile time and run time type safety, processor time savings from not having to downcast, the time to search and perform type checking, and sorting on specific properties.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;.Net 1.1 contains base classes that provide all the typical methods and properties needed to build your own strongly typed collection class.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;But as previously mentioned extra development time is needed to develop a collection class for each business class that can exist in multiple, simultaneous versions at run time.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;This leads to higher development costs and higher maintenance costs.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Business requirements grow over time, and new properties can be added to business classes that require sorting at the application tier, thus needing development time to update the collection class to allow sorting on the new properties.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Also some properties can have their exposure increased and thus needing a new “FindBy…” method in the collection.&lt;br /&gt;Much of this development time can be reduced using Generics, a new construct added to c# 2.0.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;However when environments and projects must adhere to consistent standards, before new technologies make their way into new development cycles, sometimes legacy solutions will be converted to the new technology prior to new functionality using it.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Also if it is required to maintain either backward compatibility, or existing client code, removal of the existing strongly typed collections could be prohibited.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;However reducing its code base and maintaining its existing signature is possible with Generics.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;TEXT-ALIGN:justify;"&gt;&lt;font face="Calibri" size="3"&gt;The topic of converting all your strongly typed collection classes will be discussed and broken up into 3 separate parts.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;When large enterprise applications contain many strongly typed collection classes, converting them to Generics can contain large amounts of risk and could be separated into different steps that reduce risk, and keep a higher level of quality.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;TEXT-ALIGN:justify;"&gt;&lt;font face="Calibri" size="3"&gt;Here in Converting Strongly Typed Collections to Generics Part 1, the first step will be only to reduce the amount of code in each of the strongly typed collection classes by using Generics.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;The basic structure of a non generic strongly typed collection class will be discussed with an example of all the usual parts.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Then the strongly typed collection class will have the majority of its code removed as well as changing its base class to use Generics, all the while maintaining backward compatibility.&lt;/font&gt;&lt;/p&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;h2 style="MARGIN:10pt 0in 0pt;"&gt;&lt;font face="Cambria" color="#4f81bd" size="4"&gt;Strongly Typed Collections&lt;/font&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;A strongly typed collection class has the typical methods and properties of any collection class but only accepts and processes 1 type.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;For example, see the code snippet below that illustrates some typical methods.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Note this is only a snippet of the class; download the project to see the entire collection class as well as the complete example. The snippet below illustrates the typical properties and methods that a collection class and namely a strongly typed collection class will contain.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;public class StudentCollection : BaseCollection&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Student this[int index]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp; //List handles throwing ArgumentOutOfRangeException&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get {return (Student)List[index];}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { List[index] = value; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int Add(Student student)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (student == null)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new System.ArgumentNullException(&amp;quot;student&amp;quot;, &amp;quot;Cannot Add NULL to collection.&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Is List a Unique list?&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (IsUnique &amp;amp;&amp;amp; List.Contains(student))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new System.ArgumentException(&amp;quot;Cannot add duplicate entry to collection.&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return List.Add(student);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public StudentCollection FindByMajor(string major)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StudentCollection studentCollection = new StudentCollection();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Student student in this.List)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (student.Major == major)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; studentCollection.Add(student);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return studentCollection;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="FONT-SIZE:8pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;font face="Courier New" color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="FONT-SIZE:8pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;
&lt;p&gt;&lt;br /&gt;Note the indexer only indexes on a &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;Student&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;object, and the &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;Add&lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt; method only adds a &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;Student&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;type.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Also the &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;FindByMajor&lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt; method is specific to a &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;StudentCollection&lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt; and searches only for &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;Student&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;objects.&lt;br /&gt;When using the collection, it is pretty straight forward, you can &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:blue;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;new&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;a &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;Student&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;object, add it to an instance of a &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;StudentCollection&lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;, and find a specific &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;Student &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;instances. &lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;See the code example below.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;span style="FONT-SIZE:8pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;span style="FONT-SIZE:8pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;span style="FONT-SIZE:8pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;font face="Calibri" color="#000000"&gt;Student student1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = new Student(1, &amp;quot;Ben&amp;quot;, &amp;quot;Franklin&amp;quot;, &amp;quot;Physics&amp;quot;);&lt;br /&gt;StudentCollection students &amp;nbsp;&amp;nbsp;&amp;nbsp; = new StudentCollection();&lt;br /&gt;students.Add(student1);&lt;br /&gt;StudentCollection studentsToFind = students.FindByMajor(&amp;quot;Physics&amp;quot;);&lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;Normally the collection will be filled at a database tier or other method, and the collection will contain more than 1 &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;Student&lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt; object.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;For simplicity only a snippet is shown here.&lt;br style="mso-special-character:line-break;" /&gt;&lt;br style="mso-special-character:line-break;" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;span class="Heading2Char"&gt;&lt;span style="FONT-SIZE:13pt;LINE-HEIGHT:115%;"&gt;&lt;strong&gt;&lt;font face="Cambria" color="#4f81bd"&gt;Generics&lt;br /&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Calibri" size="3"&gt;Now we will look at creating a Generic base class and removing the common code used by all collections.&amp;nbsp;&lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;font face="Calibri" size="3"&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;font face="Calibri" size="3"&gt;
&lt;p&gt;public class BaseGenericCollection&amp;lt;T&amp;gt; : System.Collections.ObjectModel.Collection&amp;lt;T&amp;gt;&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; internal List&amp;lt;T&amp;gt; m_deletedList = null;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; new public void Add(T t)&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (this.Contains(t))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new System.ArgumentException(&amp;quot;Cannot add duplicate entry to collection.&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base.Add(t);&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;The base class will inherit from &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;System.Collections.ObjectModel.&lt;span style="COLOR:#2b91af;"&gt;Collection&lt;/span&gt;&amp;lt;T&amp;gt; &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;and will contain all the typical properties and methods any collection class has, but it will be instantiated with a type and thus will maintain its type safety.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Notice there is no “FindBy…” method, because we won’t know what type this class will be instantiated with. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;Now let’s look at the Student Collection.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Remember, we are only removing the typical parts of strongly typed collection into a reusable base class that maintains type safety.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;The &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;StudentCollection&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;class will still exist, but will only contain the custom methods and/or properties specific to a &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;StudentCollection&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;class.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-no-proof:yes;"&gt;&lt;font face="Calibri" size="3"&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;span style="FONT-SIZE:8pt;COLOR:blue;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;span style="FONT-SIZE:8pt;COLOR:blue;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;COLOR:blue;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;
&lt;p&gt;&lt;font face="Calibri" color="#000000" size="3"&gt;public class StudentCollection : BaseGenericCollection&amp;lt;Student&amp;gt;&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public StudentCollection FindByMajor(string major)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StudentCollection studentCollection = new StudentCollection();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Create a temporary anonymous collection &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //and use a lambda expression to only select those students with the desired major.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //The compiler will infer the type and maintain type safety&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var students = &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Select((student, index) =&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; index, studentToFind = student.Major == major &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Loop thru the anonymous type&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var student in students)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (student.studentToFind)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; studentCollection.Add(this[student.index]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return studentCollection;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;/span&gt;&lt;/font&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;TEXT-ALIGN:justify;"&gt;&lt;font face="Calibri" size="3"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;TEXT-ALIGN:justify;"&gt;&lt;font face="Calibri" size="3"&gt;The &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;StudentCollection&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt; &lt;/span&gt;&lt;font face="Calibri" size="3"&gt;class inherits from our &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;BaseGenericCollection&lt;/span&gt;&lt;font face="Calibri" size="3"&gt; which is really a &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;Collection&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&amp;lt;T&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt; &lt;/span&gt;&lt;font face="Calibri" size="3"&gt;of &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;Student&lt;/span&gt;&lt;font face="Calibri" size="3"&gt; objects which provides the type safety that was required in the legacy application.&lt;br /&gt;We can also take advantage of other new constructs in c#3.0, namely anonymous types and lambda expressions.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;An anonymous type can be used to select a collection of student objects that meet the criteria using lambda expressions.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;The lambda expression reduces the amount of code compared to an anonymous method.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;TEXT-ALIGN:justify;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Upgrading your strongly typed collections to Generics can reduce your code base, and time to maintain the classes.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;When there are several strongly typed collections and they are used throughout the application, taking small steps in upgrading them will reduce the risk of introducing defects, and keep the quality at a level that is arguably acceptable by all the teams.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:11pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-theme-font:minor-bidi;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;Next in Part 2 we will discuss removing all the strongly typed collections and having only 1 collection used throughout your application.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;The type safety will still be maintained and the “FindBy…” methods will be moved to the tier that instantiates the Generic base class.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=137" width="1" height="1"&gt;</description><enclosure url="http://blogs.syrinx.com/blogs/dotnet/attachment/137.ashx" length="14853" type="application/x-zip-compressed" /><category domain="http://blogs.syrinx.com/blogs/dotnet/archive/tags/.Net+Generics+Collections/default.aspx">.Net Generics Collections</category></item><item><title>Best Practices for Naming Sites and Pages.</title><link>http://blogs.syrinx.com/blogs/sharepoint/archive/2008/05/25/top-tabs-are-not-highlighting-properly.aspx</link><pubDate>Sun, 25 May 2008 11:34:00 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:135</guid><dc:creator>JoeS</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;A comment I frequently hear is: SharePoint tabs don&amp;#39;t always highlight properly.&amp;nbsp; As it turns out, if you are in the habit of doing things a certain way, they always work.&lt;/p&gt;
&lt;p&gt;First, make sure you are turning on &amp;quot;Show Pages&amp;quot; and/or &amp;quot;Show subsites&amp;quot;.&amp;nbsp; You can find this in Site Settings by clicking on Navigation.&lt;/p&gt;
&lt;p&gt;Second, when you are adding sites and pages make sure their names don&amp;#39;t have spaces.&amp;nbsp; See my blog on &lt;a href="http://blogs.syrinx.com/blogs/sharepoint/archive/2008/02/06/best-practices-for-working-with-column-names-in-sharepoint.aspx"&gt;best practices for working with column names&lt;/a&gt;&amp;nbsp;for a deeper discussion; I generally extend this to everything I create in SharePoint by habit now and as it turns out why I never run into this problem.&lt;/p&gt;
&lt;p&gt;Third, when adding pages or sites to your navigation, always browse to the intended destination; this will ensure your tabs will work properly.&amp;nbsp; In fact if you compare the resulting URL after you fix a broken tab this way, you will see that the URL must be relative, not absolute.&lt;/p&gt;
&lt;p&gt;Following these best practices should prevent the problem where&amp;nbsp;SharePoint (MOSS or WSS) tabs are&amp;nbsp;not highlighting.&lt;/p&gt;
&lt;p&gt;-Joe&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=135" width="1" height="1"&gt;</description><category domain="http://blogs.syrinx.com/blogs/sharepoint/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://blogs.syrinx.com/blogs/sharepoint/archive/tags/WSS/default.aspx">WSS</category><category domain="http://blogs.syrinx.com/blogs/sharepoint/archive/tags/SharePoint+MOSS+Best+Practices/default.aspx">SharePoint MOSS Best Practices</category><category domain="http://blogs.syrinx.com/blogs/sharepoint/archive/tags/Naming+Conventions/default.aspx">Naming Conventions</category></item><item><title>Moving up to find that list</title><link>http://blogs.syrinx.com/blogs/sharepoint/archive/2008/05/18/moving-up-to-find-that-list.aspx</link><pubDate>Mon, 19 May 2008 03:04:00 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:130</guid><dc:creator>JohnF</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m going to write a bit about a problem I ran into when I wrote a bulk upload application for one of my SharePoint clients.&amp;nbsp; I found that when I was importing a document and applying a Content Type to it I needed to find the Lookup list values for one of the import fields.&amp;nbsp; In looking for a list of lookup values I started with this code:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static SPList GetListByName(SPWeb web, string listName)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPList retVal = null;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (SPList list in web.Lists)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (list.Title.ToLower().Equals(listName.ToLower()))&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retVal = list;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return retVal;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;That is, I passed in the current web and the list name that I was looking for and iterated the lists in the web looking for a name match.&amp;nbsp; That code quickly became this code:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static SPList GetListByName(SPWeb web, string listName)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return web.Lists[listName.ToLower()];&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;In this code I let the object&amp;#39;s enumerator handle the iteration for me.&amp;nbsp; So quick and easy and I&amp;#39;m done - but not so fast.&amp;nbsp; The only problem was that it didn&amp;#39;t work.&amp;nbsp; The first time I looked for a Lookup Column that wasn&amp;#39;t in the current web an Exception was thrown. Almost as soon as I started importing I needed a Lookup Column that was a site column and the document was being uploaded into the Documents folder in a sub-site, in this particular case, two sites down from the root.&lt;/p&gt;
&lt;p&gt;Once I realized that the List existed but in a different context than that in which I was looking, I figured all I would need to do was get to the root and start looking using recursion, but instead of starting at the top and searching down, I thought that starting from where I was and moving up was a better approach.&amp;nbsp; In the instance where the List is in the parent web it is easier and faster to move up using web.ParentWeb from where you are, rather than iterating down through all of the child webs using web.Webs from the root.&amp;nbsp; That got me to this point:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static SPList GetListByName(SPWeb web, string listName)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPList retVal = web.Lists[listName.ToLower()];&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (retVal == null) // recurse up&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (web.ParentWeb != null)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retVal = GetListByName(web.ParentWeb, listName);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return retVal;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;But as you can see I forgot about the Exception being thrown, so I put the recursive call into a catch block and ended up with this code:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static SPList GetListByName(SPWeb web, string listName)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPList retVal = web.Lists[listName.ToLower()];&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (retVal == null) // recurse up&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (web.ParentWeb != null)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retVal = GetListByName(web.ParentWeb, listName);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return retVal;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;This approach was the one that finally worked.&amp;nbsp; If it didn&amp;#39;t find the list by name in the current lists for the web it would throw an Exception and the catch block would then check to make sure that the retVal was still null, on the chance that the exception was thrown after it was set.&amp;nbsp; If it was null, it looked to see if the current web had a parent web and if so used that web to recursively call the method.&amp;nbsp; The two base cases in this recursion are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1. The code in the try block does not throw an error, in which case the list was found, or&lt;/li&gt;
&lt;li&gt;2. The web.ParentWeb is null, which means we are at the root of the site and the list does not exist.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;That wraps it up for this time, hope it made your life a little easier.&lt;/p&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=130" width="1" height="1"&gt;</description><category domain="http://blogs.syrinx.com/blogs/sharepoint/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://blogs.syrinx.com/blogs/sharepoint/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.syrinx.com/blogs/sharepoint/archive/tags/Lists/default.aspx">Lists</category></item><item><title>MOSS Enterprise Search. Part 2</title><link>http://blogs.syrinx.com/blogs/sharepoint/archive/2008/05/18/moss-enterprise-search-part-2.aspx</link><pubDate>Mon, 19 May 2008 02:26:14 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:129</guid><dc:creator>AndreyL</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;In this part of the series you will learn how to set up &lt;strong&gt;Search Scopes&lt;/strong&gt;. Search scopes allow to create specially defined groupings of searchable content, which can be chosen by users when executing a search.&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Go to the Sharepoint 3.0 Central Administration site  &lt;li&gt;Click on the &lt;strong&gt;Search Settings&lt;/strong&gt; link in the &lt;strong&gt;Search&lt;/strong&gt; section: &lt;br /&gt;&lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="90" alt="image" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_thumb.png" width="170" border="0" /&gt;&lt;/a&gt;  &lt;li&gt;Click &lt;strong&gt;View Scopes&lt;/strong&gt; in the &lt;strong&gt;Scopes&lt;/strong&gt; section:&lt;br /&gt;&lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_4.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="162" alt="image" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_thumb_1.png" width="244" border="0" /&gt;&lt;/a&gt;&amp;nbsp; &lt;li&gt;Click &lt;strong&gt;New Scope&lt;/strong&gt; link in the toolbar: &lt;br /&gt;&lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_6.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="92" alt="image" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_thumb_2.png" width="227" border="0" /&gt;&lt;/a&gt;&amp;nbsp; &lt;li&gt;In the Create Scope wizard you can specify title, description and target search page for the new scope. &lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_10.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="332" alt="image" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_thumb_4.png" width="555" border="0" /&gt;&lt;/a&gt;   &lt;li&gt;After pressing Ok button you get back to the View Scopes page and now you see your scope in the list:&lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_14.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="190" alt="image" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_thumb_6.png" width="488" border="0" /&gt;&lt;/a&gt; &lt;li&gt;Now click on &amp;quot;Add rules&amp;quot; link to start a New Scope Rule wizard. Four types of scope rules are supported: Web Address, Property Query, Content Source and All Content. In our example we want the scope to include MOSS site users, so we choose Property Query scope rule type, and as a property restriction we use &lt;strong&gt;contentclass, &lt;/strong&gt;specifying&lt;strong&gt; &lt;/strong&gt;following query: &lt;strong&gt;urn:content-class:SPSPeople&lt;/strong&gt; &lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_16.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="204" alt="image" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_thumb_7.png" width="498" border="0" /&gt;&lt;/a&gt; &lt;li&gt;Then we choose how the rule will be applied to the overall scope: whether any item that matches the rule will be included in the scope, or excluded from the scope, or any result in the scope has to match this rule. In our example we choose &amp;quot;Include&amp;quot;. Then click &amp;quot;OK&amp;quot; to apply the rule. &lt;li&gt;Now, if you want this search scope to be available before the next scheduled update, you can force update by going back to &lt;strong&gt;Search Settings&lt;/strong&gt; page in &lt;strong&gt;Shared Services&lt;/strong&gt; site (use site breadcrumb &lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_22.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="19" alt="image" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_thumb_10.png" width="287" border="0" /&gt;&lt;/a&gt;  ) and clicking &amp;quot;Start update now&amp;quot; link: &lt;a href="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_20.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="212" alt="image" src="http://blogs.syrinx.com/blogs/sharepoint/WindowsLiveWriter/MOSSEnterpriseSearch.Part2_129DB/image_thumb_9.png" width="603" border="0" /&gt;&lt;/a&gt; &lt;li&gt;New search copes are not added to the existing site collections automatically. We need to perform the following steps to make the scope show in the search drop down: &lt;/li&gt; &lt;ul&gt; &lt;li&gt;On the portal home page select &lt;strong&gt;Site Actions&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Site Settings&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Modify All Site Settings&lt;/strong&gt;  &lt;li&gt;Click &lt;strong&gt;Search Scopes&lt;/strong&gt; in the &lt;strong&gt;Site Collection Administration&lt;/strong&gt; section &lt;li&gt;Click &lt;strong&gt;Search Dropdown&lt;/strong&gt; link &lt;li&gt;In the scopes section choose the scopes you want to show up the search drop down, then press Ok to apply changes. &lt;li&gt;Now wait until the scheduled update completes and you should see your new search scope among those in the search drop down list.&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;img src="http://blogs.syrinx.com/aggbug.aspx?PostID=129" width="1" height="1"&gt;</description></item><item><title>Part 6 - Generating Some Classes (and an Interface)</title><link>http://blogs.syrinx.com/blogs/dotnet/archive/2008/05/12/part-6-generating-some-classes-and-an-interface.aspx</link><pubDate>Mon, 12 May 2008 14:51:00 GMT</pubDate><guid isPermaLink="false">cd544384-c566-47fe-88af-b61e5bbebb03:128</guid><dc:creator>JohnF</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;In this installation of my blog series I&amp;#39;ll cover creating integrated InterfaceObject, DataAccess and ApplicationObject (BusinessObject) classes based on the definition file that use these newly created stored procedures and provide an API to the users of our classes.&lt;/p&gt;
&lt;p&gt;The Interface, Data Access and Application objects will be created using the field values from the CodeGeneratorPropertyList.&amp;nbsp; The interface will define the basic property signatures for each field.&amp;nbsp; The Data Access class will perform CRUD and list retrieval based on the stored procedures just created.&amp;nbsp; The Application Object will interact with the Data Access class using primitive values where possible and the generated interface when not.&amp;nbsp; So, when a new item is created the DataAccess would be expecting an instance of a class that implements the interface to be passed to it.&amp;nbsp; The Application Object will pass itself as it is just such a class.&lt;/p&gt;
&lt;p&gt;The Application Object will also handle keeping track of whether or not it is dirty (a value has changed since instantiation) and whether or not it is new (the value does not yet exist in the database), s well as check some business rules.&amp;nbsp; It does this by inheriting from a base class that is standard within the code generator.&amp;nbsp; This will reduce unnecessary calls to persist unchanged items to the database or to try and delete items that do not yet exist.&amp;nbsp; The CheckRules method will initially just check that required fields are present and that fields with a given length (varchar, char, etc.) are not longer than allowed.&lt;/p&gt;
&lt;p&gt;The Application Object and the Data Access classes will both use partial classes and partial methods to take advantage of the Code Generator&amp;#39;s ability 