update 扩展dapper分页
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user