oop ----

it's an easy one ye!!

 query =  query.Where(criterion);

:s

On Aug 14, 2:49 pm, Wayne Douglas <codingvi...@googlemail.com> wrote:
> 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 nhusers@googlegroups.com
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to