Reputation: 63
I want to search through parts of the record, not only in accurate records. In this exemple I search for the accurate records:
var v = NhSession.QueryOver<Dados.Models.PersonModel>()
.Where(w=>w.Name == "Mary"))
.List();
I can do this by queryover or only with criteria?
Upvotes: 1
Views: 47
Reputation: 123861
The answer is in the: WhereRestrictionOn
. It could look like this
var v = NhSession
.QueryOver<Dados.Models.PersonModel>()
//.Where(w => w.Name == "Mary"))
.WhereRestrictionOn(w => w.Name)
.IsLike("Mary", MatchMode.Start);
.List();
The MatchMode
enum will decide where to put the '%' generated SQL Statement
Upvotes: 1