update 扩展dapper分页

This commit is contained in:
2021-05-20 11:19:08 +08:00
parent 230bda4eb1
commit 16b3688edb
2 changed files with 32 additions and 1 deletions

View File

@@ -14,16 +14,20 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dapper;
using Ewide.Core.Extension;
namespace Ewide.Application.Service.HouseCode
{
public class HouseCodeService : IHouseCodeService, IDynamicApiController, ITransient
{
private readonly IRepository<BsHouseCode> _houseCodeRep;
private readonly IDapperRepository _dapperRepository;
public HouseCodeService(IRepository<BsHouseCode> HouseCodeRep)
public HouseCodeService(IRepository<BsHouseCode> HouseCodeRep, IDapperRepository dapperRepository)
{
_houseCodeRep = HouseCodeRep;
_dapperRepository = dapperRepository;
}
[HttpPost("/houseCode/add")]
@@ -62,5 +66,11 @@ namespace Ewide.Application.Service.HouseCode
// .Join(areaCodeRep.DetachedEntities, cp => cp.p.AreaCode, a => a.Code, (cp, a) => new { cp, a })
// .Where(!string.IsNullOrEmpty(input.HouseCode), cpa => cpa.cp.c.HouseCode.Contains(input.HouseCode))
//}
public async Task<dynamic> QueryPage()
{
var sql = "SELECT * FROM bs_house_code";
return await _dapperRepository.QueryPageData(sql, new PageInputBase());
}
}
}