Files
2026-10-08 10:43:59 +08:00

18 lines
777 B
C#

using FreeSql;
using F9WebAiTest.Application.Dtos.SYS.Departments;
using F9WebAiTest.Application.Interfaces.Repositories.SYS.Departments;
using F9WebAiTest.Domain.Entities.SYS.Departments;
namespace F9WebAiTest.Infrastructure.FreeSqls.Repositories.SYS.Departments;
internal class DepartmentReadRepository : F9RepositoryBase, IDepartmentReadRepository
{
public DepartmentReadRepository(IFreeSql fsql) : base(fsql) { }
public async Task<List<DepartmentReadDto_View>> GetAllAsync()
=> await Orm.Select<Department>()
.Where(x => x.DeletedAt == null)
.OrderBy(x => x.SortOrder)
.ToListAsync(x => new DepartmentReadDto_View(x.Id, x.Code, x.Name, x.ParentId, x.ManageType, x.DutyType, x.Description, x.IsActive, x.SortOrder));
}