添加导航属性

This commit is contained in:
橙子
2022-04-16 00:01:00 +08:00
parent f15d99e168
commit 88b968e826
16 changed files with 195 additions and 13 deletions

View File

@@ -0,0 +1,17 @@
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 RoleService
{
public async Task<List<RoleEntity>> DbTest()
{
return await _repository._Db.Queryable<RoleEntity>().ToListAsync();
}
}
}

View File

@@ -0,0 +1,14 @@
using SqlSugar;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class RoleService : BaseService<RoleEntity>, IRoleService
{
public RoleService(IRepository<RoleEntity> repository) : base(repository)
{
}
}
}

View File

@@ -0,0 +1,14 @@
using SqlSugar;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class UserRoleService : BaseService<UserRoleEntity>, IUserRoleService
{
public UserRoleService(IRepository<UserRoleEntity> repository) : base(repository)
{
}
}
}

View File

@@ -65,5 +65,11 @@ namespace Yi.Framework.Service
}
return false;
}
public async Task<List<UserEntity>> GetListInRole()
{
return await _repository._Db.Queryable<UserEntity>().Includes(u => u.Roles).ToListAsync();
}
}
}