30 lines
834 B
C#
30 lines
834 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Kurs.Platform.Entities;
|
|
using Volo.Abp.Domain.Entities;
|
|
using Volo.Abp.Domain.Repositories;
|
|
|
|
namespace Kurs.Platform.Routes
|
|
{
|
|
public class RouteAppService : PlatformAppService
|
|
{
|
|
private readonly IRepository<Route, Guid> _routeRepository;
|
|
|
|
public RouteAppService(IRepository<Route, Guid> routeRepository)
|
|
{
|
|
_routeRepository = routeRepository;
|
|
}
|
|
|
|
public async Task<List<RouteDto>> GetListAsync()
|
|
{
|
|
var items = await _routeRepository.GetListAsync();
|
|
if (items is null)
|
|
{
|
|
throw new EntityNotFoundException(L["RecordNotFound"]);
|
|
}
|
|
|
|
return ObjectMapper.Map<List<Route>, List<RouteDto>>(items);
|
|
}
|
|
}
|
|
}
|