Can I customize collation of query results in nHibernate?

前端 未结 2 412
天涯浪人
天涯浪人 2021-01-12 18:09

In plain old SQL, I can do something like this:

select * from mytable COLLATE Latin1_General_CS_AS

Is there a way to specify the type of collati

2条回答
  •  天涯浪人
    2021-01-12 18:17

    Germán Schuager has managed to specify collation at run time. Take a look here.

    var user = session.CreateCriteria(typeof (User))
        .Add(Expression.Sql("Username like ? collate Modern_Spanish_CS_AS", username, NHibernateUtil.String))
        .UniqueResult();
    

提交回复
热议问题