As a continuation to Ramon's question here (http://groups.google.com/
group/nhusers/browse_frm/thread/dfe7ff130a86ebce/7f94d484a4aeaed5?
lnk=gst&q=queryover+collection+string#7f94d484a4aeaed5)
I was wondering if anyone had a (better) solution for querying a
collection of primitives using QueryOver API.
( since QueryOver is built on top of Criteria, I'm guessing Jose's
answer that it's not supported applies here as well. I'm wondering if
there's a better workaround than previously suggested).
my scenario is like so-

Given the following entity-

public class Friend
{
    public virtual string Name { get; set; }
    public virtual IEnumerable<string> Nicknames { get; set; }
}

which is mapped like so:

mapping.HasMany(x => x.Nicknames).Element("Value")  //this gets auto-
mapped to a different 'Nicknames' table

given a string, I want to retrieve friend who's name or one of his
nicknames matches that string.
I can't figure out how to do that.. here's what I've got so far:

.Where(Restrictions.Or(
                    Restrictions.On<Friend>(f =>
f.Name).IsInsensitiveLike(name),
                    Restrictions.On<Friend>(f => f.Nicknames) // i'd
like to be able to do: .Contains(name)
                     )
                     ).List();

cheers,
Jhonny

-- 
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