예제 #1
0
        /// <summary>
        /// Sum using expression. e.g. p => p.FirstName;
        /// </summary>
        /// <typeparam name="TVal">Type of values to return.</typeparam>
        /// <param name="exp">Matching expression.</param>
        /// <returns>List of distinct values.</returns>
        public virtual List <TVal> Distinct <TVal>(Expression <Func <T, object> > exp)
        {
            string propName = RepositoryExpressionHelper.GetPropertyName <T>(exp);

            return(InternalDistinct <TVal>(propName, null));
        }
예제 #2
0
        /// <summary>
        /// Group(date)(CreateDate)
        /// </summary>
        /// <typeparam name="TGroup">Type of group to use.</typeparam>
        /// <param name="exp">Matching expression.</param>
        /// <returns>List of key/value pairs.</returns>
        public virtual List <KeyValuePair <TGroup, int> > Group <TGroup>(Expression <Func <T, object> > exp)
        {
            string propName = RepositoryExpressionHelper.GetPropertyName <T>(exp);

            return(InternalGroup <TGroup>(propName, null));
        }
예제 #3
0
 /// <summary>
 /// Sum using expression. e.g. p => p.FirstName;
 /// </summary>
 /// <param name="exp">Expression representing the column name via property name</param>
 /// <returns>Average of entities.</returns>
 public virtual double Avg(Expression <Func <T, object> > exp)
 {
     return(Avg(RepositoryExpressionHelper.GetPropertyName <T>(exp)));
 }