using System.Linq.Expressions; namespace QYZH.InteractiveMagazine.IService; /// /// 基础服务定义 /// /// public interface IBaseService where T : class, new() { Task GetFirstAsync(Expression> whereExpression); /// /// 根据条件表达式查询单条数据 /// /// 表达式 /// 泛型实体 Task GetByIdAsync(Expression> expression) where R : class; Task GetByExpressionAsync(Expression> expression) where R : class; Task> GetListByExpression(Expression> expression) where T2 : class; Task UpdateAsync(T updateObj); ///// ///// 根据指定条件更新指定列 eg:Update(new SysUser(){ Status = 1 }, it => new { it.Status }, f => f.Userid == 1)); ///// 只更新Status列,条件是包含 ///// ///// 实体类 ///// 要更新列的表达式 ///// where表达式 ///// //Task UpdateAsync(T entity, Expression> expression, Expression> where); Task UpdateAsync(Expression> columns, Expression> whereExpression); Task UpdateAsync(Expression> columns, Expression> where); }