NHibernate Projection Components
Posted
by reggieboyYEAH
on Stack Overflow
See other posts from Stack Overflow
or by reggieboyYEAH
Published on 2010-06-14T05:00:04Z
Indexed on
2010/06/14
5:02 UTC
Read the original article
Hit count: 439
nhibernate
|query
Hello guys im trying to hydrate a DTO using projections in NHibernate this is my code
IList<PatientListViewModel> list =
y.CreateCriteria<Patient>()
.SetProjection(Projections.ProjectionList()
.Add(Projections.Property("Birthdate"), "Birthdate")
.Add(Projections.Property("Doctor.Id"), "DoctorId")
.Add(Projections.Property("Gender"), "Gender")
.Add(Projections.Property("Id"), "PatientId")
.Add(Projections.Property("Patient.Name.Fullname"), "Fullname")
)
.SetResultTransformer(Transformers.AliasToBean<PatientListViewModel>())
.List<PatientListViewModel>();
this code is throwing an exception? anyone know what is the problem?
here is the error message
Message: could not resolve property: Patient.Name.Fullname of: OneCare.Domain.Entities.Patient
© Stack Overflow or respective owner