如何使用 QueryOver 和 AliasToBean 将枚举值转换为字符串值?我有以下内容,但在尝试转换 Enum 时出现错误:
SomeDTO someDTO = null;
SomeReferenceAlias someReferenceAlias = null;
var jobs = query
.JoinAlias(x => x.SomeReference, () => someReferenceAlias, JoinType.InnerJoin)
.SelectList(list => list
.Select(p => p.SomeStatusEnum).WithAlias(() => someDTO.SomeStatus)//problem here
.Select(p => someReferenceAlias.Name).WithAlias(() => someDTO.Name)
)
.TransformUsing(Transformers.AliasToBean<SomeDTO>())
.Take(100)
.List<SomeDTO>();