添加关系表业务

This commit is contained in:
橙子
2022-04-26 01:31:14 +08:00
parent 2556c037ba
commit f3061ed643
13 changed files with 191 additions and 17 deletions

View File

@@ -0,0 +1,19 @@
using SqlSugar;
using System.Collections.Generic;
using System.Threading.Tasks;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class MenuService : BaseService<MenuEntity>, IMenuService
{
public async Task<List<MenuEntity>> GetMenuTreeAsync()
{
//ParentId 0,代表为根目录,只能存在一个
//复杂查询直接使用db代理
return await _repository._Db.Queryable<MenuEntity>().ToTreeAsync(it=>it.Childs,it=>it.ParentId,0);
}
}
}