添加导航属性
This commit is contained in:
17
Yi.Framework.Net6/Yi.Framework.Service/RoleService.cs
Normal file
17
Yi.Framework.Net6/Yi.Framework.Service/RoleService.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user