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.BusinessLayer/Service/BoardService.cs
Stanislav Mykhailenko 7716da6799
Add basic admin panel
2023-05-19 22:38:01 +03:00

31 lines
971 B
C#
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using AutoMapper;
using NG_2023_Kanban.BusinessLayer.Interfaces;
using NG_2023_Kanban.BusinessLayer.Models;
using NG_2023_Kanban.DataLayer.Repositories;
using NG_2023_Kanban.DataLayer.Entities;
using NG_2023_Kanban.DataLayer.Interfaces;
namespace NG_2023_Kanban.BusinessLayer.Services
{
public class BoardService : IBoardService
{
private readonly IBoardRepository _boardRepository;
private readonly IMapper _mapper;
public BoardService(IBoardRepository boardRepository, IMapper mapper)
{
_boardRepository = boardRepository;
_mapper = mapper;
}
public async Task<BoardModel> GetAsync(int id)
{
return _mapper.Map<BoardModel>(await _boardRepository.GetAsync(id));
}
public async Task<ICollection<BoardModel>> GetAllAsync()
{
return _mapper.Map<ICollection<BoardModel>>(await _boardRepository.GetAllAsync());
}
}
}