I have a project which I can't use `System.Linq`, so I am trying to create a cutsom Where method which works exactly same as linq, how can I do that?

```
var x = y.ToList().Where(t => t.Title != "Foo");

```

**SOLUTION 1**

```
protected void Page_Load(object sender, EventArgs e)
{
    var x = y.ToList().Where<Microsoft.SharePoint.Navigation.SPNavigationNode>(x => x.Title != "Foo");
}

public static class Extensions
{
    public static IEnumerable<T> Where<T>(this IEnumerable<T> source, Func<T, bool> filter)
    {
        foreach (var item in source)
        {
            if (filter(item))
                yield return item;
        }
    }
}

```

*NOTE : .NET v 2.0*