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