Hi
Given a list of strings I want to retrieve all items whose names contain one of the given strings.
for example- given {\"foo\", \"kuku\"} I want to retrieve the emplo
i used the following coding styles
QueryOver
IQueryOver rowCount = Session.QueryOver().ToRowCountQuery();
IQueryOver result = this.Session.QueryOver()
.Where(p => (p.FullNameEn.IsLike("%" + criteria.Keyword.Replace(" ", "%") + "%"))
|| (p.FullNameAr.IsLike("%" + criteria.Keyword.Replace(" ", "%") + "%"))
|| (p.IdentityNO == criteria.Keyword)
|| (p.MobileNO == criteria.Keyword)
|| (p.PatientID == patientIDKeyword)
)
.OrderBy(p => p.FullNameEn).Asc
.Take(criteria.PageSize)
.Skip((criteria.Page - 1) * criteria.PageSize);
totalCount = result.ToRowCountQuery().FutureValue().Value;
transaction.Commit();
return result.Future().ToList();
LINQ
var query = this.LINQ;
query = query.Where(p => p.VendorNameAr.Contains(criteria.Keyword.Replace(" ", "%")) ||
p.VendorNameEN.Contains(criteria.Keyword.Replace(" ", "%")));
return query.ToList();