Searching for the solution i found billow code i used to retrive only active rows
Code:
ICriteria criteria = session.CreateCriteria(typeof(MagnumCore.Patient))
.CreateAlias("Patient", "patient")
.CreateAlias("patient.Contact", "patientcontact")
.Add(Expression.Eq("patient.DocNum", patientId))
.Add(Expression.Eq("patientcontact.DocIdPatients", "patient.DocId"))
.Add(Expression.Eq("patientcontact.IsActive", "'T'"));
but when i use this i get the following error
could not resolve property: Patient of: MyProject.Patient.I also tryed this
Code:
IQuery query = session.CreateQuery("from Patient as pat inner join pat.PatientContact as PatCon where pat.DocNum= '" + patientId + "' and PatCon.IsActive='T'");
I get this error
"The value \"System.Object[]\" is not of type \"MagnumCore.Patient\" and cannot be used in this generic collection.\r\nParameter name: value"}
Is there anything i have to do with this, or is there any other way to achive this?
Thanks
Arvind