/// <summary> /// 获取求和值。 /// </summary> /// <typeparam name="TModel">当前模型类型。</typeparam> /// <param name="db">数据库实例。</param> /// <param name="column">当前列。</param> /// <param name="expression">条件表达式。</param> /// <returns>返回当前值。</returns> public static int Sum <TModel>(this IDbContextBase <TModel> db, Expression <Func <TModel, object> > column, Expression <Predicate <TModel> > expression = null) { return(db.Sum(column, expression, Convert.ToInt32)); }