I am having hard times convincing NHibernate (EF was able to do it) to filter based on the Hour property of a DateTime entity property. My entity goes something like :
public class Invoice {
// ...
public DateTime Time { get; set; }
// ...
}
I need to retrieve all the invoices that were "made" at a certain hour (let's say 22). A possible query could be :
from i in s.Linq<Invoice>()
where i.Type.Id == Invoice.Type.Local &&
i.TimeOfRegister.Hour == 22
select i
However I am being thrown an exception stating that the property Hour of TimeOfRegister could not be resolved...
LE : The details of the exception : could not resolve property: TimeOfRegister.Hour of: MyCompany.Entities.Invoice