| | |
| | | using WIDESEA_Core.DB; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_Core.AOP; |
| | | using AngleSharp.Dom; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using SharpCompress.Common; |
| | | |
| | | namespace WIDESEA_Core.BaseRepository |
| | | { |
| | |
| | | // Expression<Func<T, T2, T3, bool>> whereLambda = null) where T : class, new(){throw new NotImplementedException();} |
| | | //Task<PageModel<TEntity>> QueryPage(PaginationModel pagination){throw new NotImplementedException();} |
| | | |
| | | |
| | | public Task<TEntity> QureyDataByIdAsync(object id) |
| | | { |
| | | return _db.Queryable<TEntity>().In(id).SingleAsync(); |
| | |
| | | { |
| | | IInsertable<TEntity> insert = _db.Insertable(entity); |
| | | return insert.ExecuteReturnIdentityAsync(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导航插入数据(只支持2级) |
| | | /// </summary> |
| | | /// <param name="Entity"></param> |
| | | /// <returns></returns> |
| | | public async Task<bool> AddDataNavAsync(TEntity Entity) |
| | | { |
| | | return await _db.InsertNav(Entity).IncludesAllFirstLayer().ExecuteCommandAsync(); |
| | | } |
| | | |
| | | public Task<int> AddDataAsync(List<TEntity> listEntity) |
| | |
| | | return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).FirstAsync(); |
| | | } |
| | | |
| | | public Task<TEntity> QueryFirstNavAsync(Expression<Func<TEntity, bool>> whereExpression) |
| | | { |
| | | return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).IncludesAllFirstLayer().FirstAsync(); |
| | | } |
| | | |
| | | public Task<TResult> QueryFirstAsync<TResult>(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, TResult>> expression) |
| | | { |
| | | return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).Select(expression).FirstAsync(); |