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/ColumnRepository.cs

22 lines
705 B
C#
Raw Normal View History

2023-05-17 12:36:49 +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-17 12:36:49 +03:00
namespace NG_2023_Kanban.DataLayer.Repositories;
public class ColumnRepository : BaseRepository<Column>, IColumnRepository
{
public ColumnRepository(DatabaseContext context) : base(context) { }
2023-07-23 17:46:06 +03:00
public async Task<ICollection<Column>> GetAllAsync()
=> await _context.Set<Column>().Select(x => x).
Include(x => x.Cards).
ToListAsync();
public async Task<Column> GetAsync(int id)
=> await _context.Set<Column>().
Include(x => x.Cards).
FirstAsync(x => x.Id == id);
2023-05-17 12:36:49 +03:00
}