This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
NG_2023_Kanban/NG_2023_Kanban.DataLayer/Repositories/RoleRepository.cs

22 lines
693 B
C#
Raw Normal View History

2023-05-22 19:52:34 +03:00
using NG_2023_Kanban.DataLayer.DbStartup;
using NG_2023_Kanban.DataLayer.Entities;
using NG_2023_Kanban.DataLayer.Interfaces;
2023-07-23 17:46:06 +03:00
using Microsoft.EntityFrameworkCore;
2023-05-22 19:52:34 +03:00
namespace NG_2023_Kanban.DataLayer.Repositories;
public class RoleRepository : BaseRepository<Role>, IRoleRepository
{
public RoleRepository(DatabaseContext context) : base(context) { }
2023-07-23 17:46:06 +03:00
public async Task<ICollection<Role>> GetAllAsync()
=> await _context.Set<Role>().Select(x => x).
Include(x => x.Members).
ToListAsync();
public async Task<Role> GetAsync(int id)
=> await _context.Set<Role>().
Include(x => x.Members).
FirstAsync(x => x.Id == id);
2023-05-22 19:52:34 +03:00
}