open changes
This commit is contained in:
25
wishlist/Services/RoleService.cs
Normal file
25
wishlist/Services/RoleService.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Wishlist.Data;
|
||||
using Wishlist.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Wishlist.Services;
|
||||
|
||||
public class RoleService
|
||||
{
|
||||
private readonly ApplicationDbContext _context;
|
||||
|
||||
public RoleService(ApplicationDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public Task<List<ApplicationRole>> GetAllRolesAsync()
|
||||
{
|
||||
return _context.ApplicationRoles.ToListAsync();
|
||||
}
|
||||
|
||||
public Task<List<ApplicationRole>> GetAllRoleswithClaimsAsync()
|
||||
{
|
||||
return _context.ApplicationRoles.Include(x => x.RoleClaims).ToListAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user