DataMore1 dm1 = null;
DataMore2 dm2 = null;
var list = session.QueryOver<Data>()
.JoinAlias(data => data.DataMore1, () => dm1, NHibernate.SqlCommand.JoinType.LeftOuterJoin, Expression.Eq("Segment", 0))
.JoinAlias(data => data.DataMore2, () => dm2, NHibernate.SqlCommand.JoinType.LeftOuterJoin, Expression.Eq("Segment", 0))
.Select(d =>
new Data ()
{
PlantID = d.PlantID,
AreaID = d.AreaID,
CellID = d.CellID,
DeviceID = d.DeviceID,
StartDateTime = d.StartDateTime,
DataPoint01 = d.DataPoint01,
DataMore1 = new List<DataMore1>(new List<DataMore1>
{
new DataMore1 { Segment = dm1.Segment, DataPoint101 = dm1.DataPoint101 }
}),
DataMore2 = new List<DataMore2>(new List<DataMore2>
{
new DataMore2 { Segment = dm2.Segment, DataPoint201 = dm2.DataPoint201 }
})
})
.List<Data>();
この例外を生成します。
variable 'd' of type 'FNHSamples.Data' referenced from scope '', but it is not defined