I have this piece of code in a TaskRepository : 

```
public List<Task> GetActiveTasks()
    {

        return SessionContainer.Session
            .Query<Task>()
            .Where(t => t.IsActive())
            .ToList();
    }

```

And this is the IsActive() method in the Task Class

```
public virtual bool IsActive()                                 
{
 return States.ToList().Max().Name == "Active";
}

```

My problem is that `GetActiveTasks()` returns `NotSupportedException`.

Does anyone knows whats the problem ? I think it is not possible to call instance methods in the Where predicate. If that is not possible, is there any workaround for this? I need to get all the active tasks but I dont know how to do it if it is not like this.