I'm working on a complex search routine.
I like to search some letters by their keywords.
Each letter can have one or more keywords attached to it.
Suppose that somebody wants to search for some letters that they have 'ERP' ,'MIS' and 'SALES' keywords one can write this SQL statement:
I wrote this :
Code:
Letter letter=new Letter();
letter.Keywords.Add(Keywords.GetByName("ERP"));
letter.Keywords.Add(Keywords.GetByName("MIS"));
letter.Keywords.Add(Keywords.GetByName("SALES"));
.
.
.
using(ISession session=DAL.OpenSession())
{
return session.CreateCriteria(typeof(Letter)).Add(Example.Create(letter)).List();
}
and I got all letters :(
Is there anyway that we can use QBE to solve this problem ?
[/code]