mirror of
https://github.com/TomasiDeveloping/PlayerManagement.git
synced 2026-04-16 09:12:20 +00:00
23 lines
794 B
C#
23 lines
794 B
C#
using Application.Classes;
|
|
using Application.DataTransferObjects.VsDuelLeague;
|
|
using Application.Interfaces;
|
|
using AutoMapper;
|
|
using AutoMapper.QueryableExtensions;
|
|
using Database;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Application.Repositories;
|
|
|
|
public class VsDuelLeagueRepository(ApplicationContext context, IMapper mapper) : IVsDuelLeagueRepository
|
|
{
|
|
public async Task<Result<List<VsDuelLeagueDto>>> GetVsDuelLeaguesAsync(CancellationToken cancellationToken)
|
|
{
|
|
var vsDuelLeagues = await context.VsDuelLeagues
|
|
.ProjectTo<VsDuelLeagueDto>(mapper.ConfigurationProvider)
|
|
.AsNoTracking()
|
|
.OrderBy(vsDuelLeague => vsDuelLeague.Code)
|
|
.ToListAsync(cancellationToken);
|
|
|
|
return Result.Success(vsDuelLeagues);
|
|
}
|
|
} |