Hello, I trying to compare two dates (DateTime) in nhibernate linq: query = query.Where(l => (l.datCriacao.Date == dtLote.Date)
but the error: NHibernate.QueryException: could not resolve property: datCriacao.Date of: SAGP.Entities.Lote
anyone knows how I can solve this?
tks
From stackoverflow
-
You cant do it via current version of linq to hibernate. it is made based on Criteria API.
jaspion : and how I can do it? only with hql?Sly : Yes, hql probablyPaco : 2 current versions existSly : I mean current released versions... -
I solved the problem doing a between with the dates:
DateTime initialDate, finalDate; initialDate= DateEntity.Date; finalDate= new DateTime(DateEntity.Year, DateEntity.Month, DateEntity.Day, 23, 59, 59); query = query.Where(l => (((l.dateEntity>= initialDate) && (l.dateEntity<= finalDate))
0 comments:
Post a Comment