28 lines
846 B
C#
28 lines
846 B
C#
using Dlhis.Entity.Sys.Entities;
|
|
using Dlhis.User.Identity.Request;
|
|
using Dlhis.User.Identity.Response;
|
|
using Kurisu.AspNetCore.Utils.Extensions;
|
|
using Kurisu.Core.DataAccess.Dto;
|
|
using Kurisu.SqlSugar.Extensions;
|
|
using Kurisu.SqlSugar.Services;
|
|
|
|
namespace Dlhis.User.Identity.Services.Implements;
|
|
|
|
public class RoleService : IRoleService
|
|
{
|
|
private readonly IDbContext _dbContext;
|
|
|
|
public RoleService(IDbContext dbContext)
|
|
{
|
|
_dbContext = dbContext;
|
|
}
|
|
|
|
public async Task<Pagination<RoleRespone>> GetPageAsync(RolePageRequest request)
|
|
{
|
|
return await _dbContext.Queryable<RoleEntity>()
|
|
.WhereIF(request.Search.IsPresent(), x => x.Name.Contains(request.Search) || x.NormalizedName.Contains(request.Search))
|
|
.Select<RoleRespone>()
|
|
.ToPageListAsync(request);
|
|
}
|
|
}
|