Exemple #1
0
        /// <summary>
        /// Create an alias for a projection
        /// </summary>
        /// <param name="projection">the projection instance</param>
        /// <param name="alias">LambdaExpression returning an alias</param>
        /// <returns>return NHibernate.Criterion.IProjection</returns>
        public static IProjection WithAlias(this IProjection projection,
                                            Expression <Func <object> > alias)
        {
            string aliasContainer = ExpressionProcessor.FindPropertyExpression(alias.Body);

            return(Projections.Alias(projection, aliasContainer));
        }
Exemple #2
0
        /// <summary>
        /// Create an alias for the previous projection
        /// </summary>
        public QueryOverProjectionBuilder <T> WithAlias(Expression <Func <object> > alias)
        {
            string aliasContainer = ExpressionProcessor.FindPropertyExpression(alias.Body);

            lastProjection = Projections.Alias(lastProjection, aliasContainer);
            return(this);
        }
Exemple #3
0
 private static string GetPropertyName <TType>(Expression <Func <TType, object> > expression)
 {
     return(ExpressionProcessor.FindPropertyExpression(expression.Body));
 }