I\'ve got linq to nhibernate query:
var listka =
from i in FakturyZakupu.Queryable
where String.Compare(i.REJESTRY.REJ_KOD,sbWartoscBetween1.ToStri
NHibernate's Linq provider is very extendable. You could extend it to allow any expression, as long as you can write that expression in HQL, since NHibernate's Linq is converting to HQL.
So, if you write the extension for Between, your code could look like this:
var listka =
from i in FakturyZakupu.Queryable
where i.REJESTRY.REJ_KOD.Between(sbWartoscBetween1, sbWartoscBetween2)
select i;
lista = listka.ToList();
Here are some links to get you started:
In NHibernate v3.3.3, String.Compare is supported. A String.Compare(MyProp, "value") > 0
in a Where
expression would produce sql similar to where MyProp > 'value'
.
With queries like that, you can avoid the compare to by simply using the greater than (>) or less than (<) operators instead of String.Compare. For example:
var listka =
from i in FakturyZakupu.Queryable
where i.REJESTRY.REJ_KOD > sbWartoscBetween1.ToString() &&
i.REJESTRY.REJ_KOD < sbWartoscBetween2.ToString()
select i;
Your success with may depend upon your database's interpretation of string comparisons, but should generally work just fine.