SKE-39 getAllCompetitionCategories - method on server
This commit is contained in:
parent
e13a951ded
commit
4bb63859d2
@ -0,0 +1,29 @@
|
||||
using Abp.Authorization;
|
||||
using Abp.Domain.Repositories;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SystemKonkursow.Competition.CompetitionCategory.Dto;
|
||||
|
||||
namespace SystemKonkursow.Competition.CompetitionCategory
|
||||
{
|
||||
public class CompetitionCategoryAppService : SystemKonkursowAppServiceBase
|
||||
{
|
||||
private readonly IRepository<Domain.CompetitionCategory, int> _competitionCategoryRepository;
|
||||
|
||||
public CompetitionCategoryAppService(IRepository<Domain.CompetitionCategory, int> competitionCategoryRepository)
|
||||
{
|
||||
_competitionCategoryRepository = competitionCategoryRepository;
|
||||
}
|
||||
|
||||
[AbpAuthorize]
|
||||
public List<CompetitionCategoryDto> GetAllCompetitionCategories()
|
||||
{
|
||||
var competitionCategories = _competitionCategoryRepository.GetAll().ToList();
|
||||
|
||||
var mappedObjects = ObjectMapper.Map<List<CompetitionCategoryDto>>(competitionCategories
|
||||
.OrderBy(t => t.Name));
|
||||
|
||||
return mappedObjects;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using Abp.Application.Services.Dto;
|
||||
|
||||
namespace SystemKonkursow.Competition.CompetitionCategory.Dto
|
||||
{
|
||||
public class CompetitionCategoryDto : EntityDto<int>
|
||||
{
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using AutoMapper;
|
||||
|
||||
namespace SystemKonkursow.Competition.CompetitionCategory.Dto
|
||||
{
|
||||
public class CompetitionCategoryMapProfile : Profile
|
||||
{
|
||||
public CompetitionCategoryMapProfile()
|
||||
{
|
||||
CreateMap<Domain.CompetitionCategory, CompetitionCategoryDto>();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user