<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Andrew's Boiling It Down</title>
    <link>http://blog.binaryocean.com/</link>
    <description>Andrew Robinson's Blog</description>
    <language>en-us</language>
    <copyright>Andrew Robinson</copyright>
    <lastBuildDate>Fri, 15 Aug 2008 20:59:11 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>andleer@gmail.com</managingEditor>
    <webMaster>andleer@gmail.com</webMaster>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/binaryocean" type="application/rss+xml" /><item>
      <trackback:ping>http://blog.binaryocean.com/Trackback.aspx?guid=1c11761f-b946-4068-8d9a-fde291873a16</trackback:ping>
      <pingback:server>http://blog.binaryocean.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.binaryocean.com/PermaLink,guid,1c11761f-b946-4068-8d9a-fde291873a16.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://blog.binaryocean.com/CommentView,guid,1c11761f-b946-4068-8d9a-fde291873a16.aspx</wfw:comment>
      <wfw:commentRss>http://blog.binaryocean.com/SyndicationService.asmx/GetEntryCommentsRss?guid=1c11761f-b946-4068-8d9a-fde291873a16</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just started working with the new Entity Framework now that it has been released.
One of the first tasks that I tackled was building an EF version of my <a href="http://blog.binaryocean.com/2008/02/24/TextBoxMaxLengthFromLINQMetaData.aspx">LinqLength</a> expression
builder. Like my LinqLength expression builder, you can get a value for the MaxLength
property from your schema:
</p>
        <p>
&lt;asp:TextBox ID="TextBox1" runat="server" Columns="50" MaxLength='&lt;%$EntLength:
Bellingham.Web.BellinghamEntities:BellinghamModel:Location:Name%&gt;' /&gt;
</p>
        <p>
I am still a little confused with all of relationships going on here and whether the
model name is required to uniquely identify the entity given some database or conceptual
models so I coded for both cases. If you only pass the expression builder three parameters,
it will search across all models within the object context.
</p>
        <p>
&lt;asp:TextBox ID="TextBox1" runat="server" Columns="50" MaxLength='&lt;%$EntLength:
Bellingham.Web.BellinghamEntities:BelliLocation:Name%&gt;' /&gt;
</p>
        <p>
You will need to add this to your web.config file:
</p>
        <p>
&lt;expressionBuilders&gt;<br />
    &lt;add expressionPrefix="EntLength" type="BinaryOcean.Web.Library.EntLengthExpressionBuilder"
/&gt;<br />
&lt;/expressionBuilders&gt;
</p>
        <p>
Also, I haven't completed thorough perfomance testing but do save the Items Collection
for the csdl between calls in the HttpContext. I played with different caching methods
and I think this one is likely the best given the different trade offs. Asp.net caches
the result for each Expression Builder call so it is only called once during the application
life. (It is cached across different user threads within IIS.) Bottom line, this is
very much a work in progress.
</p>
        <p>
-Andy
</p>
        <p>
&gt;&gt;&gt;&gt;
</p>
        <p>
using System;<br />
using System.Collections.Generic;<br />
using System.Collections.ObjectModel;<br />
using System.CodeDom;<br />
using System.Data.Metadata.Edm;<br />
using System.Data.Objects;<br />
using System.Linq;<br />
using System.Web;<br />
using System.Web.Compilation;<br />
using System.Web.UI;
</p>
        <p>
namespace BinaryOcean.Web.Library<br />
{<br />
    [ExpressionPrefix("EntLength")]<br />
    public class EntLengthExpressionBuilder : ExpressionBuilder<br />
    {<br />
        public override CodeExpression GetCodeExpression(BoundPropertyEntry
entry, object parsedData, ExpressionBuilderContext context)<br />
        {<br />
            string[] parameters
= entry.Expression.Split(':');
</p>
        <p>
            CodePrimitiveExpression
expression = null;
</p>
        <p>
            if (parameters.Count()
== 3)<br />
               
expression = new CodePrimitiveExpression(GetFacetMaxLength(parameters[0], "", parameters[1],
parameters[2]));
</p>
        <p>
            if (parameters.Count()
== 4)<br />
               
expression = new CodePrimitiveExpression(GetFacetMaxLength(parameters[0], parameters[1],
parameters[2], parameters[3]));
</p>
        <p>
            if (expression
== null)<br />
               
ThrowException("Usage \"EntLength: EntityName[:ModelName]:TypeName:PropertyName\".");
</p>
        <p>
            return expression;<br />
        }
</p>
        <p>
        private int GetFacetMaxLength(string contextName,
string modelName, string entityName, string propertyName)<br />
        {<br />
            var entity = GetEntity(contextName,
modelName, entityName);
</p>
        <p>
            var property =
entity.Properties.SingleOrDefault(p =&gt; p.Name == propertyName);<br />
            if (property ==
null)<br />
               
ThrowException(string.Format("Unable to find a single Property with Name \"{0}\"",
propertyName));
</p>
        <p>
            var facet = property.TypeUsage.Facets.SingleOrDefault(f
=&gt; f.Name == "MaxLength");<br />
            if (facet == null)<br />
               
ThrowException("Unable to find Facet with Name \"MaxLength\"");
</p>
        <p>
            if (!(facet.Value
is int))<br />
               
ThrowException(string.Format("Unable to derive value from Facet \"MaxLength\" with
Value \"{0}\" on Property Name \"{1}\"", facet.Value, propertyName));
</p>
        <p>
            return (int)facet.Value;<br />
        }
</p>
        <p>
        private EntityType GetEntity(string contextName,
string modelName, string entityName)<br />
        {<br />
            var itemCollection
= GetItemCollection(contextName);
</p>
        <p>
            EntityType entity;<br />
            if (modelName.Length
&gt; 0)<br />
            {<br />
               
entity = itemCollection.SingleOrDefault(i =&gt; i.NamespaceName == modelName &amp;&amp;
i.Name == entityName);<br />
               
if (entity == null)<br />
                   
ThrowException(string.Format("Unable to find a single Entity with Model Name \"{0}\"
and Name \"{1}\"", modelName, entityName));<br />
            }<br />
            else<br />
            {<br />
               
entity = itemCollection.SingleOrDefault(i =&gt; i.Name == entityName);<br />
               
if (entity == null)<br />
                   
ThrowException(string.Format("Unable to find a single Entity with Name \"{0}\"", entityName));<br />
            }<br />
            return entity;<br />
        }
</p>
        <p>
        private ReadOnlyCollection&lt;EntityType&gt;
GetItemCollection(string contextName)<br />
        {<br />
            var dictionary
= GetDictionary();
</p>
        <p>
            if (dictionary.ContainsKey(contextName))<br />
            {<br />
               
return dictionary[contextName];<br />
            }
</p>
        <p>
            var context = (ObjectContext)Activator.CreateInstance(BuildManager.GetType(contextName,
true));<br />
            var itemCollection
= context.MetadataWorkspace.GetItemCollection(DataSpace.CSpace).GetItems&lt;EntityType&gt;();<br />
            dictionary.Add(contextName,
itemCollection);
</p>
        <p>
            return itemCollection;<br />
        }
</p>
        <p>
        private const string DictionaryCacheKey
= "177808CC-5099-4972-8113-F61137DC1875"; // use a random guid as a key to insure
uniqueness<br />
        private Dictionary&lt;string, ReadOnlyCollection&lt;EntityType&gt;&gt;
GetDictionary()<br />
        {<br />
            var dictionary
= HttpContext.Current.Items[DictionaryCacheKey] as Dictionary&lt;string, ReadOnlyCollection&lt;EntityType&gt;&gt;;
</p>
        <p>
            if (dictionary
== null)<br />
            {<br />
               
dictionary = new Dictionary&lt;string, ReadOnlyCollection&lt;EntityType&gt;&gt;();<br />
               
HttpContext.Current.Items[DictionaryCacheKey] = dictionary;<br />
            }
</p>
        <p>
            return dictionary;<br />
        }
</p>
        <p>
        private void ThrowException(string message)<br />
        {<br />
            throw new InvalidOperationException(string.Format("EntLengthExpressionBuilder:
{0}", message));<br />
        }<br />
    }<br />
}<br /></p>
        <img width="0" height="0" src="http://blog.binaryocean.com/aggbug.ashx?id=1c11761f-b946-4068-8d9a-fde291873a16" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/binaryocean/~4/heA4Uq-jcbA" height="1" width="1" /></body>
      <title>TextBox MaxLength from Entity Framework Meta Data</title>
      <guid isPermaLink="false">http://blog.binaryocean.com/PermaLink,guid,1c11761f-b946-4068-8d9a-fde291873a16.aspx</guid>
      <link>http://feedproxy.google.com/~r/binaryocean/~3/heA4Uq-jcbA/TextBoxMaxLengthFromEntityFrameworkMetaData.aspx</link>
      <pubDate>Fri, 15 Aug 2008 20:59:11 GMT</pubDate>
      <description>&lt;p&gt;
I just started working with the new Entity Framework now that it has been released.
One of the first tasks that I tackled was building an EF version of my &lt;a href="http://blog.binaryocean.com/2008/02/24/TextBoxMaxLengthFromLINQMetaData.aspx"&gt;LinqLength&lt;/a&gt; expression
builder. Like my LinqLength expression builder, you can get a value for the MaxLength
property from your schema:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;asp:TextBox ID="TextBox1" runat="server" Columns="50" MaxLength='&amp;lt;%$EntLength:
Bellingham.Web.BellinghamEntities:BellinghamModel:Location:Name%&amp;gt;' /&amp;gt;
&lt;/p&gt;
&lt;p&gt;
I am still a little confused with all of relationships going on here and whether the
model name is required to uniquely identify the entity given some database or conceptual
models so I coded for both cases. If you only pass the expression builder three parameters,
it will search across all models within the object context.
&lt;/p&gt;
&lt;p&gt;
&amp;lt;asp:TextBox ID="TextBox1" runat="server" Columns="50" MaxLength='&amp;lt;%$EntLength:
Bellingham.Web.BellinghamEntities:BelliLocation:Name%&amp;gt;' /&amp;gt;
&lt;/p&gt;
&lt;p&gt;
You will need to add this to your web.config file:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;expressionBuilders&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add expressionPrefix="EntLength" type="BinaryOcean.Web.Library.EntLengthExpressionBuilder"
/&amp;gt;&lt;br&gt;
&amp;lt;/expressionBuilders&amp;gt;
&lt;/p&gt;
&lt;p&gt;
Also, I haven't completed thorough perfomance testing but do save the Items Collection
for the csdl between calls in the HttpContext. I played with different caching methods
and I think this one is likely the best given the different trade offs. Asp.net caches
the result for each Expression Builder call so it is only called once during the application
life. (It is cached across different user threads within IIS.) Bottom line, this is
very much a work in progress.
&lt;/p&gt;
&lt;p&gt;
-Andy
&lt;/p&gt;
&lt;p&gt;
&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;/p&gt;
&lt;p&gt;
using System;&lt;br&gt;
using System.Collections.Generic;&lt;br&gt;
using System.Collections.ObjectModel;&lt;br&gt;
using System.CodeDom;&lt;br&gt;
using System.Data.Metadata.Edm;&lt;br&gt;
using System.Data.Objects;&lt;br&gt;
using System.Linq;&lt;br&gt;
using System.Web;&lt;br&gt;
using System.Web.Compilation;&lt;br&gt;
using System.Web.UI;
&lt;/p&gt;
&lt;p&gt;
namespace BinaryOcean.Web.Library&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [ExpressionPrefix("EntLength")]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public class EntLengthExpressionBuilder : ExpressionBuilder&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; public override CodeExpression GetCodeExpression(BoundPropertyEntry
entry, object parsedData, ExpressionBuilderContext context)&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; string[] parameters
= entry.Expression.Split(':');
&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; CodePrimitiveExpression
expression = 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; if (parameters.Count()
== 3)&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;
expression = new CodePrimitiveExpression(GetFacetMaxLength(parameters[0], "", parameters[1],
parameters[2]));
&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 (parameters.Count()
== 4)&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;
expression = new CodePrimitiveExpression(GetFacetMaxLength(parameters[0], parameters[1],
parameters[2], parameters[3]));
&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 (expression
== null)&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;
ThrowException("Usage \"EntLength: EntityName[:ModelName]:TypeName:PropertyName\".");
&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 expression;&lt;br&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; private int GetFacetMaxLength(string contextName,
string modelName, string entityName, string propertyName)&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; var entity = GetEntity(contextName,
modelName, entityName);
&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; var property =
entity.Properties.SingleOrDefault(p =&amp;gt; p.Name == propertyName);&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 (property ==
null)&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;
ThrowException(string.Format("Unable to find a single Property with Name \"{0}\"",
propertyName));
&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; var facet = property.TypeUsage.Facets.SingleOrDefault(f
=&amp;gt; f.Name == "MaxLength");&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 (facet == null)&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;
ThrowException("Unable to find Facet with Name \"MaxLength\"");
&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 (!(facet.Value
is int))&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;
ThrowException(string.Format("Unable to derive value from Facet \"MaxLength\" with
Value \"{0}\" on Property Name \"{1}\"", facet.Value, propertyName));
&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 (int)facet.Value;&lt;br&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; private EntityType GetEntity(string contextName,
string modelName, string entityName)&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; var itemCollection
= GetItemCollection(contextName);
&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; EntityType entity;&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 (modelName.Length
&amp;gt; 0)&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;
entity = itemCollection.SingleOrDefault(i =&amp;gt; i.NamespaceName == modelName &amp;amp;&amp;amp;
i.Name == entityName);&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;
if (entity == null)&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;
ThrowException(string.Format("Unable to find a single Entity with Model Name \"{0}\"
and Name \"{1}\"", modelName, entityName));&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; else&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;
entity = itemCollection.SingleOrDefault(i =&amp;gt; i.Name == entityName);&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;
if (entity == null)&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;
ThrowException(string.Format("Unable to find a single Entity with Name \"{0}\"", entityName));&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; return entity;&lt;br&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; private ReadOnlyCollection&amp;lt;EntityType&amp;gt;
GetItemCollection(string contextName)&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; var dictionary
= GetDictionary();
&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 (dictionary.ContainsKey(contextName))&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;
return dictionary[contextName];&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;/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; var context = (ObjectContext)Activator.CreateInstance(BuildManager.GetType(contextName,
true));&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; var itemCollection
= context.MetadataWorkspace.GetItemCollection(DataSpace.CSpace).GetItems&amp;lt;EntityType&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; dictionary.Add(contextName,
itemCollection);
&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 itemCollection;&lt;br&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; private const string DictionaryCacheKey
= "177808CC-5099-4972-8113-F61137DC1875"; // use a random guid as a key to insure
uniqueness&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private Dictionary&amp;lt;string, ReadOnlyCollection&amp;lt;EntityType&amp;gt;&amp;gt;
GetDictionary()&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; var dictionary
= HttpContext.Current.Items[DictionaryCacheKey] as Dictionary&amp;lt;string, ReadOnlyCollection&amp;lt;EntityType&amp;gt;&amp;gt;;
&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 (dictionary
== null)&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;
dictionary = new Dictionary&amp;lt;string, ReadOnlyCollection&amp;lt;EntityType&amp;gt;&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;
HttpContext.Current.Items[DictionaryCacheKey] = dictionary;&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;/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 dictionary;&lt;br&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; private void ThrowException(string message)&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 InvalidOperationException(string.Format("EntLengthExpressionBuilder:
{0}", message));&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; }&lt;br&gt;
}&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.binaryocean.com/aggbug.ashx?id=1c11761f-b946-4068-8d9a-fde291873a16" /&gt;</description>
      <comments>http://blog.binaryocean.com/CommentView,guid,1c11761f-b946-4068-8d9a-fde291873a16.aspx</comments>
    <feedburner:origLink>http://blog.binaryocean.com/2008/08/15/TextBoxMaxLengthFromEntityFrameworkMetaData.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://blog.binaryocean.com/Trackback.aspx?guid=a5670b5c-8c5c-42bb-9595-8d1069b39b94</trackback:ping>
      <pingback:server>http://blog.binaryocean.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.binaryocean.com/PermaLink,guid,a5670b5c-8c5c-42bb-9595-8d1069b39b94.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://blog.binaryocean.com/CommentView,guid,a5670b5c-8c5c-42bb-9595-8d1069b39b94.aspx</wfw:comment>
      <wfw:commentRss>http://blog.binaryocean.com/SyndicationService.asmx/GetEntryCommentsRss?guid=a5670b5c-8c5c-42bb-9595-8d1069b39b94</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I use SourceGear <a href="http://www.sourcegear.com/vault/">Vault</a> and generally
love it. Guessing the following is not directly related to Vault but rather source
control in general. By default, Vault is configured to ignore the Bin folder within
an ASP.NET project or Web Site.
</p>
        <p>
What have I been doing for years when I need to import a vendor's DLL to my project?
Yup, I copy it to my Bin folder and add a reference to it. Wrong thing to do!
</p>
        <p>
That 3rd party DLL is not achieved along with the rest of my project since Vault is
configured to ignore the Bin folder. (Guessing that all source control systems follow
this behavior.) What should be doing instead? Create a folder within my project along
the lines of AcmeLibrary and copy DLLs there. Then reference my DLLs and Visual Studio
will copy them to your Bin folder when you build your project. The AcmeLibrary and
its contents will be placed under source control.
</p>
        <p>
Hope this saves you some future grief!<br /></p>
        <img width="0" height="0" src="http://blog.binaryocean.com/aggbug.ashx?id=a5670b5c-8c5c-42bb-9595-8d1069b39b94" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/binaryocean/~4/p-rPG3iZbVY" height="1" width="1" /></body>
      <title>Source Control and the Bin folder</title>
      <guid isPermaLink="false">http://blog.binaryocean.com/PermaLink,guid,a5670b5c-8c5c-42bb-9595-8d1069b39b94.aspx</guid>
      <link>http://feedproxy.google.com/~r/binaryocean/~3/p-rPG3iZbVY/SourceControlAndTheBinFolder.aspx</link>
      <pubDate>Mon, 31 Mar 2008 14:53:51 GMT</pubDate>
      <description>&lt;p&gt;
I use SourceGear &lt;a href="http://www.sourcegear.com/vault/"&gt;Vault&lt;/a&gt; and generally
love it. Guessing the following is not directly related to Vault but rather source
control in general. By default, Vault is configured to ignore the Bin folder within
an ASP.NET project or Web Site.
&lt;/p&gt;
&lt;p&gt;
What have I been doing for years when I need to import a vendor's DLL to my project?
Yup, I copy it to my Bin folder and add a reference to it. Wrong thing to do!
&lt;/p&gt;
&lt;p&gt;
That 3rd party DLL is not achieved along with the rest of my project since Vault is
configured to ignore the Bin folder. (Guessing that all source control systems follow
this behavior.) What should be doing instead? Create a folder within my project&amp;nbsp;along
the lines of AcmeLibrary and copy DLLs there. Then reference my DLLs and Visual Studio
will copy them to your Bin folder when you build your project. The AcmeLibrary and
its contents will be placed under source control.
&lt;/p&gt;
&lt;p&gt;
Hope this saves you some future grief!&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.binaryocean.com/aggbug.ashx?id=a5670b5c-8c5c-42bb-9595-8d1069b39b94" /&gt;</description>
      <comments>http://blog.binaryocean.com/CommentView,guid,a5670b5c-8c5c-42bb-9595-8d1069b39b94.aspx</comments>
    <feedburner:origLink>http://blog.binaryocean.com/2008/03/31/SourceControlAndTheBinFolder.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://blog.binaryocean.com/Trackback.aspx?guid=f35f1a03-d640-4cfe-8498-229661ba754a</trackback:ping>
      <pingback:server>http://blog.binaryocean.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.binaryocean.com/PermaLink,guid,f35f1a03-d640-4cfe-8498-229661ba754a.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://blog.binaryocean.com/CommentView,guid,f35f1a03-d640-4cfe-8498-229661ba754a.aspx</wfw:comment>
      <wfw:commentRss>http://blog.binaryocean.com/SyndicationService.asmx/GetEntryCommentsRss?guid=f35f1a03-d640-4cfe-8498-229661ba754a</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <font color="#000000">I find myself repeating the same little code pattern time after
time when building a LINQ expression based on a number of optional filtering criteria.
Using standard if statements seems a bit verbose to me. </font>
        </p>
        <p>
          <font face="Courier New" color="#000000">if (SearchControlMain.CategoryID.HasValue) 
<br />
    query = query.Where(q =&gt; q.CategoryID == SearchControlMain.CategoryID);</font>
        </p>
        <p>
          <font face="Courier New" color="#000000">if (SearchControlMain.TypeID.HasValue) 
<br />
    query = query.Where(q =&gt; q.TypeID == SearchControlMain.TypeID);</font>
        </p>
        <p>
          <font face="Courier New" color="#000000">if (SearchControlMain.PostingID.HasValue) 
<br />
    query = query.Where(q =&gt; q.PostingID == SearchControlMain.PostingID);</font>
        </p>
        <p>
          <br />
          <font color="#000000">Completely inlining the if statements doesn't do much for readability.</font>
        </p>
        <p>
          <font face="Courier New" color="#000000">if (SearchControlMain.CategoryID.HasValue)
query = query.Where(q =&gt; q.CategoryID == SearchControlMain.CategoryID);<br />
if (SearchControlMain.TypeID.HasValue) query = query.Where(q =&gt; q.TypeID == SearchControlMain.TypeID);<br />
if (SearchControlMain.PostingID.HasValue) query = query.Where(q =&gt; q.PostingID
== SearchControlMain.PostingID);</font>
        </p>
        <p>
          <br />
          <font color="#000000">So I created a couple of quick extension methods on both the
IEnumerable and IQueryable forms of Where. I named my new extension WhereIf but I
struggled a bit as to whether to name it just Where and wind up with an overload.</font>
        </p>
        <p>
          <font color="#000000">Now you can code:</font>
        </p>
        <p>
          <font face="Courier New" color="#000000">query = query.WhereIf(SearchControlMain.CategoryID.HasValue,
q =&gt; q.CategoryID == SearchControlMain.CategoryID);<br />
query = query.WhereIf(SearchControlMain.TypeID.HasValue, q =&gt; q.TypeID == SearchControlMain.TypeID);<br />
query = query.WhereIf(SearchControlMain.PostingID.HasValue, q =&gt; q.PostingID ==
SearchControlMain.PostingID);</font>
        </p>
        <p>
          <br />
          <font color="#000000">Here are the extension methods:</font>
        </p>
        <p>
          <font face="Courier New" color="#000000">public static IEnumerable&lt;TSource&gt;
WhereIf&lt;TSource&gt;(this IEnumerable&lt;TSource&gt; source, bool condition, Func&lt;TSource,
bool&gt; predicate)<br />
{<br />
    if (condition)<br />
        return source.Where(predicate);<br />
    else<br />
        return source;<br />
}</font>
        </p>
        <p>
          <font face="Courier New" color="#000000">public static IEnumerable&lt;TSource&gt;
WhereIf&lt;TSource&gt;(this IEnumerable&lt;TSource&gt; source, bool condition, Func&lt;TSource,
int, bool&gt; predicate)<br />
{<br />
    if (condition)<br />
        return source.Where(predicate);<br />
    else<br />
        return source;<br />
}</font>
        </p>
        <p>
          <font face="Courier New" color="#000000">public static IQueryable&lt;TSource&gt; WhereIf&lt;TSource&gt;(this
IQueryable&lt;TSource&gt; source, bool condition, Expression&lt;Func&lt;TSource, bool&gt;&gt;
predicate)<br />
{<br />
    if (condition)<br />
        return source.Where(predicate);<br />
    else<br />
        return source;<br />
}</font>
        </p>
        <p>
          <font face="Courier New" color="#000000">public static IQueryable&lt;TSource&gt; WhereIf&lt;TSource&gt;(this
IQueryable&lt;TSource&gt; source, bool condition, Expression&lt;Func&lt;TSource, int,
bool&gt;&gt; predicate)<br />
{<br />
    if (condition)<br />
        return source.Where(predicate);<br />
    else<br />
        return source;<br />
}</font>
        </p>
        <img width="0" height="0" src="http://blog.binaryocean.com/aggbug.ashx?id=f35f1a03-d640-4cfe-8498-229661ba754a" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/binaryocean/~4/Jt8nG97TRaE" height="1" width="1" /></body>
      <title>LINQ WhereIf Extension Method</title>
      <guid isPermaLink="false">http://blog.binaryocean.com/PermaLink,guid,f35f1a03-d640-4cfe-8498-229661ba754a.aspx</guid>
      <link>http://feedproxy.google.com/~r/binaryocean/~3/Jt8nG97TRaE/LINQWhereIfExtensionMethod.aspx</link>
      <pubDate>Fri, 07 Mar 2008 16:29:01 GMT</pubDate>
      <description>&lt;p&gt;
&lt;font color=#000000&gt;I find myself repeating the same little code pattern time after
time when building a LINQ expression based on a number of optional filtering criteria.
Using standard if statements&amp;nbsp;seems a bit verbose to me. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New" color=#000000&gt;if (SearchControlMain.CategoryID.HasValue) 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; query = query.Where(q =&amp;gt; q.CategoryID == SearchControlMain.CategoryID);&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New" color=#000000&gt;if (SearchControlMain.TypeID.HasValue) 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; query = query.Where(q =&amp;gt; q.TypeID == SearchControlMain.TypeID);&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New" color=#000000&gt;if (SearchControlMain.PostingID.HasValue) 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; query = query.Where(q =&amp;gt; q.PostingID == SearchControlMain.PostingID);&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;font color=#000000&gt;Completely inlining the if statements doesn't do much for readability.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New" color=#000000&gt;if (SearchControlMain.CategoryID.HasValue)
query = query.Where(q =&amp;gt; q.CategoryID == SearchControlMain.CategoryID);&lt;br&gt;
if (SearchControlMain.TypeID.HasValue) query = query.Where(q =&amp;gt; q.TypeID == SearchControlMain.TypeID);&lt;br&gt;
if (SearchControlMain.PostingID.HasValue) query = query.Where(q =&amp;gt; q.PostingID
== SearchControlMain.PostingID);&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;font color=#000000&gt;So I created a couple of quick extension methods on both the IEnumerable
and IQueryable forms of Where. I named my new extension WhereIf but I struggled a
bit as to whether to name it just Where and wind up with an overload.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#000000&gt;Now you can code:&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New" color=#000000&gt;query = query.WhereIf(SearchControlMain.CategoryID.HasValue,
q =&amp;gt; q.CategoryID == SearchControlMain.CategoryID);&lt;br&gt;
query = query.WhereIf(SearchControlMain.TypeID.HasValue, q =&amp;gt; q.TypeID == SearchControlMain.TypeID);&lt;br&gt;
query = query.WhereIf(SearchControlMain.PostingID.HasValue, q =&amp;gt; q.PostingID ==
SearchControlMain.PostingID);&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;font color=#000000&gt;Here are the extension methods:&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New" color=#000000&gt;public static IEnumerable&amp;lt;TSource&amp;gt; WhereIf&amp;lt;TSource&amp;gt;(this
IEnumerable&amp;lt;TSource&amp;gt; source, bool condition, Func&amp;lt;TSource, bool&amp;gt; predicate)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (condition)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return source.Where(predicate);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return source;&lt;br&gt;
}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New" color=#000000&gt;public static IEnumerable&amp;lt;TSource&amp;gt; WhereIf&amp;lt;TSource&amp;gt;(this
IEnumerable&amp;lt;TSource&amp;gt; source, bool condition, Func&amp;lt;TSource, int, bool&amp;gt;
predicate)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (condition)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return source.Where(predicate);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return source;&lt;br&gt;
}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New" color=#000000&gt;public static IQueryable&amp;lt;TSource&amp;gt; WhereIf&amp;lt;TSource&amp;gt;(this
IQueryable&amp;lt;TSource&amp;gt; source, bool condition, Expression&amp;lt;Func&amp;lt;TSource, bool&amp;gt;&amp;gt;
predicate)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (condition)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return source.Where(predicate);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return source;&lt;br&gt;
}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New" color=#000000&gt;public static IQueryable&amp;lt;TSource&amp;gt; WhereIf&amp;lt;TSource&amp;gt;(this
IQueryable&amp;lt;TSource&amp;gt; source, bool condition, Expression&amp;lt;Func&amp;lt;TSource, int,
bool&amp;gt;&amp;gt; predicate)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (condition)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return source.Where(predicate);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return source;&lt;br&gt;
}&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.binaryocean.com/aggbug.ashx?id=f35f1a03-d640-4cfe-8498-229661ba754a" /&gt;</description>
      <comments>http://blog.binaryocean.com/CommentView,guid,f35f1a03-d640-4cfe-8498-229661ba754a.aspx</comments>
      <category>LINQ</category>
    <feedburner:origLink>http://blog.binaryocean.com/2008/03/07/LINQWhereIfExtensionMethod.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://blog.binaryocean.com/Trackback.aspx?guid=5d239c86-c44c-4680-a45e-07c5692c291e</trackback:ping>
      <pingback:server>http://blog.binaryocean.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.binaryocean.com/PermaLink,guid,5d239c86-c44c-4680-a45e-07c5692c291e.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://blog.binaryocean.com/CommentView,guid,5d239c86-c44c-4680-a45e-07c5692c291e.aspx</wfw:comment>
      <wfw:commentRss>http://blog.binaryocean.com/SyndicationService.asmx/GetEntryCommentsRss?guid=5d239c86-c44c-4680-a45e-07c5692c291e</wfw:commentRss>
      <title>Convert an array of type string to type int II</title>
      <guid isPermaLink="false">http://blog.binaryocean.com/PermaLink,guid,5d239c86-c44c-4680-a45e-07c5692c291e.aspx</guid>
      <link>http://feedproxy.google.com/~r/binaryocean/~3/imBPZ-3tCHo/ConvertAnArrayOfTypeStringToTypeIntII.aspx</link>
      <pubDate>Tue, 26 Feb 2008 00:19:12 GMT</pubDate>
      <description>&lt;p&gt;
An update on an &lt;a href="http://blog.binaryocean.com/2006/02/17/ConvertAnArrayOfTypeStringToTypeInt.aspx"&gt;older
posting&lt;/a&gt; now that we have LINQ:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;font size=3&gt;&lt;span style="COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;string&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;[]
input = { &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"1"&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"2"&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"3"&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"4"&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"5"&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"6"&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"7"&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"8"&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"9"&lt;/span&gt;&lt;font color=#000000&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt; };&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="COLOR: green; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;//
old&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;font size=3&gt;&lt;span style="COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;int&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;[]
output = &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;Array&lt;/span&gt;&lt;font color=#000000&gt;.ConvertAll&amp;lt;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt;&amp;gt;(input, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;delegate&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt; s)
{ &lt;/font&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt;.Parse(s);
});&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="COLOR: green; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;//
new&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;font size=3&gt;&lt;span style="COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;int&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;[]
output = &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;Array&lt;/span&gt;&lt;font color=#000000&gt;.ConvertAll(input,
s =&amp;gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt;.Parse(s));&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="COLOR: green; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;//
even better&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;input.Select(s
=&amp;gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt;.Parse(s)).ToArray();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="COLOR: green; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;//
better yet&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;input.Select(s
=&amp;gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt;.Parse(s)).ToList();&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.binaryocean.com/aggbug.ashx?id=5d239c86-c44c-4680-a45e-07c5692c291e" /&gt;&lt;img src="http://feeds.feedburner.com/~r/binaryocean/~4/imBPZ-3tCHo" height="1" width="1"/&gt;</description>
      <comments>http://blog.binaryocean.com/CommentView,guid,5d239c86-c44c-4680-a45e-07c5692c291e.aspx</comments>
    <feedburner:origLink>http://blog.binaryocean.com/2008/02/26/ConvertAnArrayOfTypeStringToTypeIntII.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://blog.binaryocean.com/Trackback.aspx?guid=703d47b2-253f-446e-b2c8-fbb3dff00506</trackback:ping>
      <pingback:server>http://blog.binaryocean.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.binaryocean.com/PermaLink,guid,703d47b2-253f-446e-b2c8-fbb3dff00506.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://blog.binaryocean.com/CommentView,guid,703d47b2-253f-446e-b2c8-fbb3dff00506.aspx</wfw:comment>
      <wfw:commentRss>http://blog.binaryocean.com/SyndicationService.asmx/GetEntryCommentsRss?guid=703d47b2-253f-446e-b2c8-fbb3dff00506</wfw:commentRss>
      <title>TextBox MaxLength from LINQ Meta Data</title>
      <guid isPermaLink="false">http://blog.binaryocean.com/PermaLink,guid,703d47b2-253f-446e-b2c8-fbb3dff00506.aspx</guid>
      <link>http://feedproxy.google.com/~r/binaryocean/~3/wn6YYTjjWd4/TextBoxMaxLengthFromLINQMetaData.aspx</link>
      <pubDate>Sun, 24 Feb 2008 23:43:19 GMT</pubDate>
      <description>&lt;p&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; mso-bidi-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-ansi-language: EN"&gt;&lt;font face="Courier New" color=#0000ff&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; LINE-HEIGHT: 115%; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-ansi-language: EN"&gt;&lt;font face=Verdana&gt;When
you use the LINQ to SQL design surface in Visual Studio, the generated code contains
a Column Attribute which in turn contains a small piece of SQL text called the DbType.
This property contains the column length for columns of type Char and VarChar. Using
a bit of reflection, you can gain access to the value. Wrapping all of this within
an ExpressionBuilder, you can easily set the MaxLength property of any TextBox declaratively
in your web pages.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; LINE-HEIGHT: 115%; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-ansi-language: EN"&gt;&lt;font face=Verdana&gt;Here
is the code for the Expression Builder:&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&gt;&gt; 
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 10pt; LINE-HEIGHT: 18pt"&gt;
&lt;font face=Calibri&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; mso-bidi-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-ansi-language: EN"&gt;&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;using&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; System;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;using&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; System.CodeDom;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;using&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; System.Data.Linq.Mapping;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;using&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; System.Linq;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;using&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; System.Reflection;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;using&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; System.Web.Compilation;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;using&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; System.Web.UI;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;namespace&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; BinaryOcean.Web.Utility&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; 
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[&lt;span style="COLOR: #2b91af"&gt;ExpressionPrefix&lt;/span&gt;(&lt;span style="COLOR: #a31515"&gt;"LinqLength"&lt;/span&gt;)]&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;LinqLengthExpressionBuilder&lt;/span&gt; : &lt;span style="COLOR: #2b91af"&gt;ExpressionBuilder&lt;o:p&gt;&lt;/o:p&gt;
&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;override&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;CodeExpression&lt;/span&gt; GetCodeExpression(&lt;span style="COLOR: #2b91af"&gt;BoundPropertyEntry&lt;/span&gt; entry, &lt;span style="COLOR: blue"&gt;object&lt;/span&gt; parsedData, &lt;span style="COLOR: #2b91af"&gt;ExpressionBuilderContext&lt;/span&gt; context)&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt; typeName
= BeforeLast(entry.Expression, &lt;span style="COLOR: #a31515"&gt;"."&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt; propertyName
= AfterLast(entry.Expression, &lt;span style="COLOR: #a31515"&gt;"."&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;CodePrimitiveExpression&lt;/span&gt;(PropertyLength(typeName,
propertyName));&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;int&lt;/span&gt; PropertyLength(&lt;span style="COLOR: blue"&gt;string&lt;/span&gt; typeName, &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; propertyName)&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;ColumnAttribute&lt;/span&gt; attribute
=&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(&lt;span style="COLOR: #2b91af"&gt;ColumnAttribute&lt;/span&gt;)&lt;span style="COLOR: #2b91af"&gt;BuildManager&lt;o:p&gt;&lt;/o:p&gt;
&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;.GetType(typeName, &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;.GetProperty(propertyName)&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;.GetCustomAttributes(&lt;span style="COLOR: blue"&gt;typeof&lt;/span&gt;(&lt;span style="COLOR: #2b91af"&gt;ColumnAttribute&lt;/span&gt;), &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;.Single(); &lt;span style="COLOR: green"&gt;//
&amp;lt;-- look, I just had to use a tiny bit of LINQ in this code!&lt;o:p&gt;&lt;/o:p&gt;
&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: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;int&lt;/span&gt;.Parse(BetweenFirst(attribute.DbType, &lt;span style="COLOR: #a31515"&gt;"char("&lt;/span&gt;, &lt;span style="COLOR: #a31515"&gt;")"&lt;/span&gt;));&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; BeforeLast(&lt;span style="COLOR: blue"&gt;string&lt;/span&gt; value, &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; last)&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; value.Substring(0,
value.LastIndexOf(last));&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; AfterLast(&lt;span style="COLOR: blue"&gt;string&lt;/span&gt; value, &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; last)&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; value.Substring(value.LastIndexOf(last)
+ last.Length);&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; BetweenFirst(&lt;span style="COLOR: blue"&gt;string&lt;/span&gt; value, &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; startText, &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; endText)&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; start
= value.IndexOf(startText, &lt;span style="COLOR: #2b91af"&gt;StringComparison&lt;/span&gt;.OrdinalIgnoreCase)
+ startText.Length;&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; end
= value.IndexOf(endText, start,&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;StringComparison&lt;/span&gt;.OrdinalIgnoreCase);&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; value.Substring(start,
end - start);&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&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: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;font face=Verdana&gt;You must add the following bit of code to the system.web / compilation
section of your web.config file. This loads the ExpressionBuilder which interprets
your code.&lt;/font&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;/span&gt; 
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;&amp;lt;&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;system.web&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;compilation&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; &lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;debug&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;=&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;"&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;true&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;"&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;expressionBuilders&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;add&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; &lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;expressionPrefix&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;=&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;"&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;LinqLength&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;"&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; &lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;type&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;=&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;"&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;BinaryOcean.Web.Utility.LinqLengthExpressionBuilder&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;"&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;expressionBuilders&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;compilation&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;&amp;lt;/&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;system.web&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;
&lt;o:p&gt;
&lt;font face=Verdana&gt;The use of BuildManager.GetType() within the Expression Builder
should allow you to reference dbml objects within you local AppCode folder or either
local or external namespaces. Given that Name is a database column contained within
the Employee table you can code this:&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;&amp;lt;&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;asp&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;:&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;TextBox&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; &lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;ID&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;="TextBoxName"&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; &lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;runat&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;="server"&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; &lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;MaxLength&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;='&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; BACKGROUND: yellow; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;$LinqLength:Employee.Name&lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;'&lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt; &lt;/span&gt;&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; mso-bidi-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-ansi-language: EN"&gt;If
you are using Web Projects or if&amp;nbsp;your data context is in a different&amp;nbsp;namespace
from your web application, you will have to prefix the above type with your namespace
(and add dot ("."));&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; mso-bidi-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-ansi-language: EN"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="BACKGROUND: white; MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span lang=EN style="FONT-SIZE: 10pt; COLOR: black; mso-bidi-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-ansi-language: EN"&gt;Enjoy!&lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.binaryocean.com/aggbug.ashx?id=703d47b2-253f-446e-b2c8-fbb3dff00506" /&gt;&lt;img src="http://feeds.feedburner.com/~r/binaryocean/~4/wn6YYTjjWd4" height="1" width="1"/&gt;</description>
      <comments>http://blog.binaryocean.com/CommentView,guid,703d47b2-253f-446e-b2c8-fbb3dff00506.aspx</comments>
      <category>LINQ</category>
    <feedburner:origLink>http://blog.binaryocean.com/2008/02/24/TextBoxMaxLengthFromLINQMetaData.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://blog.binaryocean.com/Trackback.aspx?guid=ce5471b9-48f0-481b-8f0d-ec58ee4b3259</trackback:ping>
      <pingback:server>http://blog.binaryocean.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.binaryocean.com/PermaLink,guid,ce5471b9-48f0-481b-8f0d-ec58ee4b3259.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://blog.binaryocean.com/CommentView,guid,ce5471b9-48f0-481b-8f0d-ec58ee4b3259.aspx</wfw:comment>
      <wfw:commentRss>http://blog.binaryocean.com/SyndicationService.asmx/GetEntryCommentsRss?guid=ce5471b9-48f0-481b-8f0d-ec58ee4b3259</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Love my new Zune, but I wasn't able to install the software. Received the
following error:
</p>
        <p>
Installation Failed<br />
Setup must stop because the required package ‘Zune’ failed to install.<br />
DIFXAPP: Rollback failed with error 0x2<br />
Error code: 0x80070643<br /><a href="http://go.microsoft.com/fwlink/?LinkID=101253">http://go.microsoft.com/fwlink/?LinkID=101253</a></p>
        <p>
Looking at the support boards, it seems that a number of people are having this issue.
I did find a reference to an obscure registry hack that disabled the installer's ability
to rollback after a failed install. This seemed to fix the issue but I tried upgrading
to the new 2.3 version of the software which recently became available. No go. Infact,
the upgrade process failed and broke my previously working software.
</p>
        <p>
Yuck! I once again followed the link in the above error message. It was of zero
help. On a lark, I tried re-enabling the Firewall Service that I had long ago disabled.
Fixed! Seems that you can turn your firewall off, but can't disable the service. Guessing
the install was trying to configure ports on the firewall.
</p>
        <p>
Zune: Great product. Zune client software: Poor QA.
</p>
        <img src="http://blog.binaryocean.com/content/binary/ZuneInstallFailed.gif" border="0" />
        <img width="0" height="0" src="http://blog.binaryocean.com/aggbug.ashx?id=ce5471b9-48f0-481b-8f0d-ec58ee4b3259" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/binaryocean/~4/CZ_X9I3-EmU" height="1" width="1" /></body>
      <title>Zune Software Install Failure. Fix: Enable the Firewall Service.</title>
      <guid isPermaLink="false">http://blog.binaryocean.com/PermaLink,guid,ce5471b9-48f0-481b-8f0d-ec58ee4b3259.aspx</guid>
      <link>http://feedproxy.google.com/~r/binaryocean/~3/CZ_X9I3-EmU/ZuneSoftwareInstallFailureFixEnableTheFirewallService.aspx</link>
      <pubDate>Mon, 28 Jan 2008 22:20:20 GMT</pubDate>
      <description>&lt;p&gt;
Love&amp;nbsp;my new Zune, but&amp;nbsp;I wasn't able to install the software. Received the
following error:
&lt;/p&gt;
&lt;p&gt;
Installation Failed&lt;br&gt;
Setup must stop because the required package ‘Zune’ failed to install.&lt;br&gt;
DIFXAPP: Rollback failed with error 0x2&lt;br&gt;
Error code: 0x80070643&lt;br&gt;
&lt;a href="http://go.microsoft.com/fwlink/?LinkID=101253"&gt;http://go.microsoft.com/fwlink/?LinkID=101253&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Looking at the support boards, it seems that a number of people are having this issue.
I did find a reference to an obscure registry hack that disabled the installer's ability
to rollback after a failed install. This seemed to fix the issue but I tried upgrading
to the new 2.3 version of the software which recently became available. No go. Infact,
the upgrade process failed and broke my previously working software.
&lt;/p&gt;
&lt;p&gt;
Yuck! I once again&amp;nbsp;followed the link in the above error message. It was of zero
help. On a lark, I tried re-enabling the Firewall Service that I had&amp;nbsp;long ago&amp;nbsp;disabled.
Fixed! Seems that you can turn your firewall off, but can't disable the service. Guessing
the install was trying to configure ports on the firewall.
&lt;/p&gt;
&lt;p&gt;
Zune: Great product. Zune client software: Poor QA.
&lt;/p&gt;
&lt;img src="http://blog.binaryocean.com/content/binary/ZuneInstallFailed.gif" border=0&gt;&lt;img width="0" height="0" src="http://blog.binaryocean.com/aggbug.ashx?id=ce5471b9-48f0-481b-8f0d-ec58ee4b3259" /&gt;</description>
      <comments>http://blog.binaryocean.com/CommentView,guid,ce5471b9-48f0-481b-8f0d-ec58ee4b3259.aspx</comments>
    <feedburner:origLink>http://blog.binaryocean.com/2008/01/28/ZuneSoftwareInstallFailureFixEnableTheFirewallService.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://blog.binaryocean.com/Trackback.aspx?guid=37269070-be95-428b-9a60-8a3cbd11e2dc</trackback:ping>
      <pingback:server>http://blog.binaryocean.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.binaryocean.com/PermaLink,guid,37269070-be95-428b-9a60-8a3cbd11e2dc.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://blog.binaryocean.com/CommentView,guid,37269070-be95-428b-9a60-8a3cbd11e2dc.aspx</wfw:comment>
      <wfw:commentRss>http://blog.binaryocean.com/SyndicationService.asmx/GetEntryCommentsRss?guid=37269070-be95-428b-9a60-8a3cbd11e2dc</wfw:commentRss>
      <title>A System.Collections.Generic.Dictionary with a compound key</title>
      <guid isPermaLink="false">http://blog.binaryocean.com/PermaLink,guid,37269070-be95-428b-9a60-8a3cbd11e2dc.aspx</guid>
      <link>http://feedproxy.google.com/~r/binaryocean/~3/M-s_kukCgK8/ASystemCollectionsGenericDictionaryWithACompoundKey.aspx</link>
      <pubDate>Fri, 28 Sep 2007 14:43:04 GMT</pubDate>
      <description>&lt;p class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt"&gt;&lt;font color=#000000&gt;&lt;font face=Consolas&gt;&lt;font size=3&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;I
recently needed a dictionary for a small project. Nothing special there but on this
occasion, I needed a dictionary that was keyed by two sub-keys. I thought about using
an array but you loose strong typing. I thought about using&amp;nbsp; a dictionary of
dictionaries but the code is&amp;nbsp;messy, complicated and difficult to maintain. Here
is a better solution. (I also coded structures that allow for compound keys with 3
and 4 values. If you need that, just expand on the 2 key version.):&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt"&gt;
&lt;o:p&gt;
&lt;font face=Consolas color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;[&lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;Serializable&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;StructLayout&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;LayoutKind&lt;/span&gt;&lt;font color=#000000&gt;.Sequential)]&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;font size=3&gt;&lt;span style="COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;public&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;struct&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;CompoundKey&lt;/span&gt;&lt;font color=#000000&gt;&amp;lt;T1,
T2&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt;&lt;font color=#000000&gt; T1
key1;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt;&lt;font color=#000000&gt; T2
key2;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt;&lt;font color=#000000&gt; CompoundKey(T1
key1, T2 key2)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;&lt;font color=#000000&gt;.key1
= key1;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;&lt;font color=#000000&gt;.key2
= key2;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt;&lt;font color=#000000&gt; T1
Key1&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;get&lt;/span&gt;&lt;font color=#000000&gt; { &lt;/font&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;&lt;font color=#000000&gt;.key1;
}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt;&lt;font color=#000000&gt; T2
Key2&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;get&lt;/span&gt;&lt;font color=#000000&gt; { &lt;/font&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;&lt;font color=#000000&gt;.key2;
}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;override&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt; ToString()&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;StringBuilder&lt;/span&gt;&lt;font color=#000000&gt; builder
= &lt;/font&gt;&lt;span style="COLOR: blue"&gt;new&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;StringBuilder&lt;/span&gt;&lt;font color=#000000&gt;();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;builder.Append(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;'['&lt;/span&gt;&lt;font color=#000000&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt;&lt;font color=#000000&gt; (&lt;/font&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;&lt;font color=#000000&gt;.Key1
!= &lt;/font&gt;&lt;span style="COLOR: blue"&gt;null&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;builder.Append(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;&lt;font color=#000000&gt;.Key1.ToString());&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;builder.Append(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;",
"&lt;/span&gt;&lt;font color=#000000&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt;&lt;font color=#000000&gt; (&lt;/font&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;&lt;font color=#000000&gt;.Key2
!= &lt;/font&gt;&lt;span style="COLOR: blue"&gt;null&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;builder.Append(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;&lt;font color=#000000&gt;.Key2.ToString());&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;builder.Append(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;']'&lt;/span&gt;&lt;font color=#000000&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&lt;font color=#000000&gt; builder.ToString();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font face=Consolas&gt;&lt;font size=3&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font face=Consolas color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt"&gt;&lt;font color=#000000&gt;&lt;font face=Consolas&gt;&lt;font size=3&gt;My
dictionary:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font face=Consolas color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Consolas&gt;&lt;font size=3&gt;&lt;span style="FONT-SIZE: 11pt; COLOR: #2b91af; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;Dictionary&lt;/span&gt;&lt;span style="FONT-SIZE: 11pt; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&amp;lt;&lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;CompoundKey&lt;/span&gt;&lt;font color=#000000&gt;&amp;lt;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt;&amp;gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt;&amp;gt;
dictionary = &lt;/font&gt;&lt;span style="COLOR: blue"&gt;new&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;Dictionary&lt;/span&gt;&lt;font color=#000000&gt;&amp;lt;&lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;CompoundKey&lt;/span&gt;&lt;font color=#000000&gt;&amp;lt;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt;&amp;gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt;&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font face=Consolas color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;dictionary.Add(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;new&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;CompoundKey&lt;/span&gt;&lt;font color=#000000&gt;&amp;lt;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt;&amp;gt;(1, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"A"&lt;/span&gt;&lt;font color=#000000&gt;), &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"X123"&lt;/span&gt;&lt;font color=#000000&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;dictionary.Add(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;new&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;CompoundKey&lt;/span&gt;&lt;font color=#000000&gt;&amp;lt;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt;&amp;gt;(2, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"B"&lt;/span&gt;&lt;font color=#000000&gt;), &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"M394"&lt;/span&gt;&lt;font color=#000000&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font face=Consolas&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;dictionary.Add(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;new&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;CompoundKey&lt;/span&gt;&lt;font color=#000000&gt;&amp;lt;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt;&amp;gt;(3, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"B"&lt;/span&gt;&lt;font color=#000000&gt;), &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"M395"&lt;/span&gt;&lt;font color=#000000&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font face=Consolas color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;font size=3&gt;&lt;span style="COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;if&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt; (dictionary.ContainsKey(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;new&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;CompoundKey&lt;/span&gt;&lt;font color=#000000&gt;&amp;lt;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt;&amp;gt;(3, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"B"&lt;/span&gt;&lt;font color=#000000&gt;)))&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font size=3&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Fred
= dictionary[&lt;/font&gt;&lt;span style="COLOR: blue"&gt;new&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;CompoundKey&lt;/span&gt;&lt;font color=#000000&gt;&amp;lt;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt;&amp;gt;(3, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"B"&lt;/span&gt;&lt;font color=#000000&gt;)];&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font face=Consolas color=#000000 size=3&gt;}&lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 11pt"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size=3&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.binaryocean.com/aggbug.ashx?id=37269070-be95-428b-9a60-8a3cbd11e2dc" /&gt;&lt;img src="http://feeds.feedburner.com/~r/binaryocean/~4/M-s_kukCgK8" height="1" width="1"/&gt;</description>
      <comments>http://blog.binaryocean.com/CommentView,guid,37269070-be95-428b-9a60-8a3cbd11e2dc.aspx</comments>
    <feedburner:origLink>http://blog.binaryocean.com/2007/09/28/ASystemCollectionsGenericDictionaryWithACompoundKey.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://blog.binaryocean.com/Trackback.aspx?guid=1c1df69e-dd5a-4eaa-92cb-91600a828e2c</trackback:ping>
      <pingback:server>http://blog.binaryocean.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.binaryocean.com/PermaLink,guid,1c1df69e-dd5a-4eaa-92cb-91600a828e2c.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://blog.binaryocean.com/CommentView,guid,1c1df69e-dd5a-4eaa-92cb-91600a828e2c.aspx</wfw:comment>
      <wfw:commentRss>http://blog.binaryocean.com/SyndicationService.asmx/GetEntryCommentsRss?guid=1c1df69e-dd5a-4eaa-92cb-91600a828e2c</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <title>Connect to and communicate with your Master Page from within a User Control</title>
      <guid isPermaLink="false">http://blog.binaryocean.com/PermaLink,guid,1c1df69e-dd5a-4eaa-92cb-91600a828e2c.aspx</guid>
      <link>http://feedproxy.google.com/~r/binaryocean/~3/IcvyOOM-3Yc/ConnectToAndCommunicateWithYourMasterPageFromWithinAUserControl.aspx</link>
      <pubDate>Sun, 26 Aug 2007 04:28:37 GMT</pubDate>
      <description>&lt;font face=Calibri color=#000000 size=3&gt;ASP.NET Tip: Occasionally I need to establish
a line of communication between a User Control and my Master Page. Over the years,
I have explored a few methods to accomplish this and seen more than a handful from
others. The following method elegantly solves a number of problems for me and has
become my standard coding practice.&lt;/font&gt; 
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;First, a base class is needed for all Master
Pages:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;font size=3&gt;&lt;span style="COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;using&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt; System;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&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;font size=3&gt;&lt;span style="COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;public&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;abstract&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;class&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;BaseMaster&lt;/span&gt;&lt;font color=#000000&gt; :
System.Web.UI.&lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;MasterPage&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt;&lt;font color=#000000&gt; BaseMaster()
{ }&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;abstract&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;void&lt;/span&gt;&lt;font color=#000000&gt; ShowMenu(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;bool&lt;/span&gt;&lt;font color=#000000&gt; visible);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;abstract&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;void&lt;/span&gt;&lt;font color=#000000&gt; SetStatusMessage(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt; message);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000 size=3&gt;}&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;I define this class as abstract since it will
never be instantiated directly. In addition, an abstract class allows us to include
abstract methods and properties which in turn requires us to provides these methods
on our actual Master Page.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;My actual master page is coded as follows:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;font size=3&gt;&lt;span style="COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;using&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt; System;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&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;font size=3&gt;&lt;span style="COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;public&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;partial&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;class&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;Main&lt;/span&gt;&lt;font color=#000000&gt; : &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;BaseMaster&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;protected&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;void&lt;/span&gt;&lt;font color=#000000&gt; Page_Load(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;object&lt;/span&gt;&lt;font color=#000000&gt; sender, &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;EventArgs&lt;/span&gt;&lt;font color=#000000&gt; e)
{ }&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;override&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;void&lt;/span&gt;&lt;font color=#000000&gt; ShowMenu(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;bool&lt;/span&gt;&lt;font color=#000000&gt; visible)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;MenuMain.Visible
= visible;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;override&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;void&lt;/span&gt;&lt;font color=#000000&gt; SetStatusMessage(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt; message)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;LabelStatus.Text
= message;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Within a User Control, you can gain access
to the Master Page via the Page.Master object. Using our base class (BaseMaster) you
get a strongly typed object. You migh be tempted to cast the Page.Master object to
the type of your Master Page but this limits you to a single Master Page. The base
class method allows your site to implement multiple master pages and still access
these common methods and properties.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;font size=3&gt;&lt;span style="COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;using&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt; System;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&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;font size=3&gt;&lt;span style="COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;public&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;partial&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;class&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;WebUserControl&lt;/span&gt;&lt;font color=#000000&gt; :
System.Web.UI.&lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;UserControl&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;protected&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;void&lt;/span&gt;&lt;font color=#000000&gt; Page_Load(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;object&lt;/span&gt;&lt;font color=#000000&gt; sender, &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;EventArgs&lt;/span&gt;&lt;font color=#000000&gt; e)
{ }&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;protected&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;void&lt;/span&gt;&lt;font color=#000000&gt; ButtonUpdate_Click(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;object&lt;/span&gt;&lt;font color=#000000&gt; sender, &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;EventArgs&lt;/span&gt;&lt;font color=#000000&gt; e)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;BaseMaster&lt;/span&gt;&lt;font color=#000000&gt; master
= Page.Master &lt;/font&gt;&lt;span style="COLOR: blue"&gt;as&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;BaseMaster&lt;/span&gt;&lt;font color=#000000&gt;;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt;&lt;font color=#000000&gt; (master
== &lt;/font&gt;&lt;span style="COLOR: blue"&gt;null&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&lt;font color=#000000&gt;;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;master.SetStatusMessage(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"Update
Complete"&lt;/span&gt;&lt;font color=#000000&gt;);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&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-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000 size=3&gt;}&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;One final consideration: your User Control
should likely also derive from some type of base class. Within this base class provide
matching properties and methods to those in your BaseMaster. This will simplify things
for you by eliminating the need to recode the same methods and properties in each
of your User Controls. If you are acessing these same methods from your Page, consider
including methods in a page base class.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.binaryocean.com/aggbug.ashx?id=1c1df69e-dd5a-4eaa-92cb-91600a828e2c" /&gt;&lt;img src="http://feeds.feedburner.com/~r/binaryocean/~4/IcvyOOM-3Yc" height="1" width="1"/&gt;</description>
      <comments>http://blog.binaryocean.com/CommentView,guid,1c1df69e-dd5a-4eaa-92cb-91600a828e2c.aspx</comments>
    <feedburner:origLink>http://blog.binaryocean.com/2007/08/26/ConnectToAndCommunicateWithYourMasterPageFromWithinAUserControl.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://blog.binaryocean.com/Trackback.aspx?guid=6837e92f-6d1e-47ac-9dd9-f2e4379f8567</trackback:ping>
      <pingback:server>http://blog.binaryocean.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.binaryocean.com/PermaLink,guid,6837e92f-6d1e-47ac-9dd9-f2e4379f8567.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://blog.binaryocean.com/CommentView,guid,6837e92f-6d1e-47ac-9dd9-f2e4379f8567.aspx</wfw:comment>
      <wfw:commentRss>http://blog.binaryocean.com/SyndicationService.asmx/GetEntryCommentsRss?guid=6837e92f-6d1e-47ac-9dd9-f2e4379f8567</wfw:commentRss>
      <title>Quick ASP.NET ViewState Tip</title>
      <guid isPermaLink="false">http://blog.binaryocean.com/PermaLink,guid,6837e92f-6d1e-47ac-9dd9-f2e4379f8567.aspx</guid>
      <link>http://feedproxy.google.com/~r/binaryocean/~3/fnoN-xS2dKg/QuickASPNETViewStateTip.aspx</link>
      <pubDate>Tue, 14 Aug 2007 18:08:49 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;I see this a lot:&lt;/font&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: 12pt; COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt; CompanyID&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;get&lt;o:p&gt;&lt;/o:p&gt;
&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt;&lt;font color=#000000&gt; (ViewState[&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"CompanyID"&lt;/span&gt;&lt;font color=#000000&gt;]
== &lt;/font&gt;&lt;span style="COLOR: blue"&gt;null&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ViewState[&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"CompanyID
"&lt;/span&gt;&lt;font color=#000000&gt;] = 0;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt;.Parse(ViewState[&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"CompanyID
"&lt;/span&gt;&lt;font color=#000000&gt;].ToString());&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;set&lt;/span&gt;&lt;font color=#000000&gt; {
ViewState[&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"CompanyID "&lt;/span&gt;&lt;font color=#000000&gt;]
= &lt;/font&gt;&lt;span style="COLOR: blue"&gt;value&lt;/span&gt;&lt;font color=#000000&gt;; }&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;
&lt;br&gt;
What is wrong with it? 2 things:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face=Calibri size=3&gt;1.&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face=Calibri size=3&gt;ViewState
stores and returns an object so the get{} portion of the property that first converts
this to a string and then parses it back to an integer is rather inefficient.&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face=Calibri size=3&gt;2.&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face=Calibri&gt;&lt;font size=3&gt;This
particular property is wrapping a value type (int) and as such, there is no need to
persist the default value in &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;font size=3&gt;ViewState.
This unnecessarily adds to the size of ViewState on a page. A better approach would
be to return the default value (or any value you choose) when the ViewState object
is null.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;So, a better solution:&lt;/font&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: 12pt; COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt; CompanyID&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;get&lt;/span&gt;&lt;font color=#000000&gt; { &lt;/font&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&lt;font color=#000000&gt; (&lt;/font&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;&lt;font color=#000000&gt;)(ViewState[&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"CompanyID"&lt;/span&gt;&lt;font color=#000000&gt;]
?? 0); }&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;set&lt;/span&gt;&lt;font color=#000000&gt; {
ViewState[&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"CompanyID"&lt;/span&gt;&lt;font color=#000000&gt;]
= &lt;/font&gt;&lt;span style="COLOR: blue"&gt;value&lt;/span&gt;&lt;font color=#000000&gt;; }&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;}&lt;br&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Remember that the C# coalescing operator (??)
returns the left side value if said value is non-null and the right side value when
the left side is null. We don't create an entry in ViewState until we assign a non-nulll
value.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;One thing to watch out for when using this
pattern is when storing certain reference types in the ViewState object.&lt;/font&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: 12pt; COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;private&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;Dictionary&lt;/span&gt;&lt;font color=#000000&gt;&amp;lt;&lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;Guid&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;bool&lt;/span&gt;&lt;font color=#000000&gt;&amp;gt;
ToAttach&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;get&lt;o:p&gt;&lt;/o:p&gt;
&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt;&lt;font color=#000000&gt; (ViewState[&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"ToAttach"&lt;/span&gt;&lt;font color=#000000&gt;]
== &lt;/font&gt;&lt;span style="COLOR: blue"&gt;null&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ViewState[&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"ToAttach
"&lt;/span&gt;&lt;font color=#000000&gt;] = &lt;/font&gt;&lt;span style="COLOR: blue"&gt;new&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;Dictionary&lt;/span&gt;&lt;font color=#000000&gt;&amp;lt;&lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;Guid&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;bool&lt;/span&gt;&lt;font color=#000000&gt;&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&lt;font color=#000000&gt; (&lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;Dictionary&lt;/span&gt;&lt;font color=#000000&gt;&amp;lt;&lt;/font&gt;&lt;span style="COLOR: #2b91af"&gt;Guid&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;bool&lt;/span&gt;&lt;font color=#000000&gt;&amp;gt;)ViewState[&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"ToAttach
"&lt;/span&gt;&lt;font color=#000000&gt;];&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&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: 12pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;set&lt;/span&gt;&lt;font color=#000000&gt; {
ViewState[&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"ToAttach "&lt;/span&gt;&lt;font color=#000000&gt;]
= &lt;/font&gt;&lt;span style="COLOR: blue"&gt;value&lt;/span&gt;&lt;font color=#000000&gt;; }&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Testing for null and assigning an empty dictionary
in the get{} portion of the property insures that we always return the same object
once it is newed up. If we didn’t perform this test and tried using the coalescing
operator as we did with the value type above, we would return a different object each
time the property is reference&amp;nbsp;and any&amp;nbsp;code attempting to manipulate the
object without explicitly setting the value&amp;nbsp;would fail.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.binaryocean.com/aggbug.ashx?id=6837e92f-6d1e-47ac-9dd9-f2e4379f8567" /&gt;&lt;img src="http://feeds.feedburner.com/~r/binaryocean/~4/fnoN-xS2dKg" height="1" width="1"/&gt;</description>
      <comments>http://blog.binaryocean.com/CommentView,guid,6837e92f-6d1e-47ac-9dd9-f2e4379f8567.aspx</comments>
    <feedburner:origLink>http://blog.binaryocean.com/2007/08/14/QuickASPNETViewStateTip.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://blog.binaryocean.com/Trackback.aspx?guid=da528913-6a3b-46e1-bf48-86f030d1d604</trackback:ping>
      <pingback:server>http://blog.binaryocean.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.binaryocean.com/PermaLink,guid,da528913-6a3b-46e1-bf48-86f030d1d604.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://blog.binaryocean.com/CommentView,guid,da528913-6a3b-46e1-bf48-86f030d1d604.aspx</wfw:comment>
      <wfw:commentRss>http://blog.binaryocean.com/SyndicationService.asmx/GetEntryCommentsRss?guid=da528913-6a3b-46e1-bf48-86f030d1d604</wfw:commentRss>
      <title>Outlook and RSS</title>
      <guid isPermaLink="false">http://blog.binaryocean.com/PermaLink,guid,da528913-6a3b-46e1-bf48-86f030d1d604.aspx</guid>
      <link>http://feedproxy.google.com/~r/binaryocean/~3/aFOVOqV800o/OutlookAndRSS.aspx</link>
      <pubDate>Tue, 26 Jun 2007 21:44:21 GMT</pubDate>
      <description>&lt;p class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Consolas&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;The
server hosting my exchange account had a major hardware failure last week that eventually
resulted in a full rebuild and restore. I was without email for 3 days. No major complaints
and in the end, I didn't lose anything.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Consolas color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Consolas&gt;The only issue: somehow my Outlook
/ Exchange based RSS feeds failed to re-sync after the restore. These were already
very flakey and I was already giving serious thought to moving back to News Gator.
The server failure and subsequent syncing issues only pushed me over the edge. I really
tried to make the Microsoft solution work but in the end, I just couldn't handle it
any more.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.binaryocean.com/aggbug.ashx?id=da528913-6a3b-46e1-bf48-86f030d1d604" /&gt;&lt;img src="http://feeds.feedburner.com/~r/binaryocean/~4/aFOVOqV800o" height="1" width="1"/&gt;</description>
      <comments>http://blog.binaryocean.com/CommentView,guid,da528913-6a3b-46e1-bf48-86f030d1d604.aspx</comments>
    <feedburner:origLink>http://blog.binaryocean.com/2007/06/26/OutlookAndRSS.aspx</feedburner:origLink></item>
  </channel>
</rss>
