hi i've ran into a problem with the following code:

<code>
IList<Expression<Func<User, bool>>> criteria = new
List<Expression<Func<User, bool>>>();
var sn = incommingUser.ScreenName;
criteria.Add(user => user.Name == username);

var users = Repository.FindAll(criteria);

</code>

and in the repository:

<code>
public virtual IList<T> FindAll<T>(IList<Expression<Func<T, bool>>> criteria)
        {
            var query = from item in _sessionManager.OpenSession().Linq<T>()
                        select item;
            foreach (var criterion in criteria)
            {
                query.Where(criterion);
            }
            return query.ToList();
        }
</code>

it seems to ommit the criteria altogether and just does a select all
with no where - any ideas why?

-- 
Cheers,

w://

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to