我有一个 Session.QueryOver,我需要维护,我想删除列名的神奇字符串,例如:
return Session.QueryOver<T>()
.SelectList(list => list
.Select(Projections.SqlGroupProjection(
"CANDIES(" + MagicalStringForColumnName +") As [Candies]",
"CANDIES(" + MagicalStringForColumnName + ")",
new[] { "Candies" },
new IType[] { NHibernateUtil.Int32 }))
我希望它像:
return Session.QueryOver<T>()
.SelectList(list => list
.Select(Projections.SqlGroupProjection(
"CANDIES(" + Session.GetColumnNameFromMappedProperty(propInfo.Name) +") As [Candies]",
"CANDIES(" + Session.GetColumnNameFromMappedProperty(propInfo.Name) + ")",
new[] { "Candies" },
new IType[] { NHibernateUtil.Int32 }))