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

22 lines
695 B
C#
Raw Permalink 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 CardRepository : BaseRepository<Card>, ICardRepository
{
public CardRepository(DatabaseContext context) : base(context) { }
2023-07-23 17:46:06 +03:00
public async Task<ICollection<Card>> GetAllAsync()
=> await _context.Set<Card>().Select(x => x).
Include(x => x.Comments).
ToListAsync();
public async Task<Card> GetAsync(int id)
=> await _context.Set<Card>().
Include(x => x.Comments).
FirstAsync(x => x.Id == id);
2023-05-17 12:36:49 +03:00
}