<p>I have an IList of type Breadcrumb which is just a lightweight class that has NavigationTitle, NavigationUrl and IsCurrent properties. It is cached on the webserver. I have a method that builds out the current breadcrumb trail up until the first Breadcrumb that has IsCurrent set to true... using the code below. Its very ugly and definitely a quick dirtbag willie solution, but I was curious, can this be easily refactored into LINQ? </p>

<pre><code>IList&lt;Breadcrumb&gt; crumbs = new List&lt;Breadcrumb&gt;();
bool foundCurrent = false;
for (int a = 0; a &lt; cachedCrumbs.Count; a++)
{
    crumbs.Add(crumbs[a]);
    if (foundCurrent)
    {
      break;
    }
    foundCurrent = (crumbs[a + 1] != null &amp;&amp; ((Breadcrumb)crumbs[a + 1]).IsCurrent);
}
</code></pre>

First of all, that code doesn't work.  I'm gonna guess that some of those places where you used "crumbs" you meant "cachedCrumbs".  If so, the code can be reduced to:
```
```
IList<Breadcrumb> crumbs = new List<Breadcrumb>();
for (int a = 0; a < cachedCrumbs.Count; a++)
{
    crumbs.Add(cachedCrumbs[a]);
    if (cachedCrumbs[a] != null && cachedCrumbs[a].IsCurrent)
    {
          break;
    }
}
```
```