尝试将查询结果投影到整数列表中。如何做到这一点?应该用什么变压器。AliasToBean 不起作用,因为它需要 setter。
var accessFeeYears = _session.QueryOver<AgreementAccessFee>()
.JoinAlias(a => a.FeeType, () => agreementAccessFeeTypeAlias)
.Where(x => x.Agreement.Id == request.AgreementId
&& agreementAccessFeeTypeAlias.Code ==AgreementAccessFeeTypeCode.FlatChargePerInsured)
.SelectList(list => list
.Select(a => a.PolicyYear).WithAlias(() =>policyYear))
.TransformUsing(Transformers.??????)
.List<int>();