More fluent C# / .NET
<p>A co-worker of mine came up with this and I wonder what others think? Personally, I find it interesting but wonder if it is too big a departure? Code examples below. Extension methods at the bottom.</p>

<p>General thoughts please. Other extension methods that could be added?</p>

<pre><code>var ddl = Page.FindControl("LocationDropDownList") as DropDownList;

ddl.Visible = true;
ddl.SelectedValue = "123";

if(isAdmin)
    ddl  .SelectedValue = "111";
</code></pre>

<p>Becomes:</p>

<pre><code>Page.FindControl("LocationDropDownList")
    .CastAs&lt;DropDownList&gt;()
    .With(d =&gt; d.Visible = true)
    .With(d =&gt; d.SelectedValue = "123")
    .WithIf(isAdmin, d =&gt; d.Items.Add(new ListItem("Admin", "1")));
</code></pre>

<p>Or:</p>

<pre><code> Page.FindControl("LocationDropDownList")
       .CastAs&lt;DropDownList&gt;()
       .With(d =&gt;
       {
           d.Visible = true;
           d.SelectedValue = "123";
       })
       .WithIf(isAdmin, d =&gt; d.SelectedValue = "111");
</code></pre>

<p>Extension methods:</p>

<pre><code>public static TResult CastAs&lt;TResult&gt;(this object obj) where TResult : class
{
    return obj as TResult;
}

public static T With&lt;T&gt;(this T t, Action&lt;T&gt; action)
{
    if (action == null)
        throw new ArgumentNullException("action");

    action(t);

    return t;
}

public static T WithIf&lt;T&gt;(this T t, bool condition, Action&lt;T&gt; action)
{
    if (action == null)
        throw new ArgumentNullException("action");

    if (condition)
        action(t);

    return t;
}
</code></pre>
