I am trying to write a query for selection using DateTime. Year as a where parameter, but I get this error from nunit:
NHibernate.QueryException: Failed to resolve property: Register.Year of: Estudantino.Domain.Events
In the Events class, I have a property named Register as a DateTime type.
public virtual DateTime Registada { get; set; }
This is the method returning the error:
using (ISession session = NHibernateHelper.OpenSession()) { return session.QueryOver<Evento>() .Where(x => x.Register.Year == year) .List(); }
This variable year is of type int , which was passed to the method.
Does anyone have an idea of ββwhat I'm doing wrong? My database server is SQL Server 2005 Express.
source share