我需要使用nhibernate调用mysql函数,类似的sql语句:
select * from concat(',', ServiceCodes, ',') like '%,33,%';
或select * from (','||ServiceCodes||',') like '%,33,%';
所以我就这样调用:
//.....
or.Add(Restrictions.Like(Projections.SqlFunction("concat", NHibernateUtil.String, Projections.Property("ServiceCodes")), "%," + item + ",%"));
//....
Projections.SqlFunction函数第三个参数是params IProjection[] projections,但是对于逗号(,)我不知道怎么创建IProjection类似。
请各位指教。。。