using System.Linq.Expressions; using Fake.Domain.Entities; using Fake.DomainDrivenDesign.Repositories.SqlSugarCore; namespace InterfaceForward.Repositories; public interface IBasicRepository: ISqlSugarRepository where T : class, IAggregateRoot, new() { public ISugarQueryable AsQueryable(); /// /// top 1 /// /// /// Task GetFirstAsync(Expression> whereExpression); Task GetFirstAsync(Expression> whereExpression,Expression> resultExpression); /// /// get list /// /// /// Task> GetListAsync(Expression> whereExpression); Task> GetListAsync(Expression> whereExpression,Expression> resultExpression); /// /// count /// /// /// Task CountAsync(Expression> exp); /// /// exists /// /// /// Task IsAnyAsync(Expression> exp); /// /// update /// /// /// 要忽略更新的列 /// Task UpdateAsync(T entity, Expression> ignoreColumns); /// /// update /// /// /// 要更新的列 /// Task UpdateColumnAsync(T entity, Expression> updateColumns); /// /// update /// /// /// 不更新null值列 /// 不更新默认值列 /// Task UpdateAsync(T entity, bool ignoreAllNullColumns = false, bool ignoreAllDefaultValue = false); /// /// 批量更新 /// /// /// 要更新的列 /// Task UpdateRangeAsync(List entities, Expression> updateColumns = null); /// /// 软删 /// /// /// Task SoftDeleteAsync(Expression> where); /// /// insert /// /// /// Task InsertAsync(T insertObj); /// /// 新增返回id /// /// /// Task InsertReturnIdentityAsync(T insertObj); /// /// 批量insert /// /// /// Task InsertRangeAsync(List entities); }