diff --git a/SystemKonkursow/4.2.1/aspnet-core/src/SystemKonkursow.Application/Competition/CompetitionCategory/CompetitionCategoryAppService.cs b/SystemKonkursow/4.2.1/aspnet-core/src/SystemKonkursow.Application/Competition/CompetitionCategory/CompetitionCategoryAppService.cs new file mode 100644 index 0000000..ba5a141 --- /dev/null +++ b/SystemKonkursow/4.2.1/aspnet-core/src/SystemKonkursow.Application/Competition/CompetitionCategory/CompetitionCategoryAppService.cs @@ -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 _competitionCategoryRepository; + + public CompetitionCategoryAppService(IRepository competitionCategoryRepository) + { + _competitionCategoryRepository = competitionCategoryRepository; + } + + [AbpAuthorize] + public List GetAllCompetitionCategories() + { + var competitionCategories = _competitionCategoryRepository.GetAll().ToList(); + + var mappedObjects = ObjectMapper.Map>(competitionCategories + .OrderBy(t => t.Name)); + + return mappedObjects; + } + } +} diff --git a/SystemKonkursow/4.2.1/aspnet-core/src/SystemKonkursow.Application/Competition/CompetitionCategory/Dto/CompetitionCategoryDto.cs b/SystemKonkursow/4.2.1/aspnet-core/src/SystemKonkursow.Application/Competition/CompetitionCategory/Dto/CompetitionCategoryDto.cs new file mode 100644 index 0000000..48dd8fa --- /dev/null +++ b/SystemKonkursow/4.2.1/aspnet-core/src/SystemKonkursow.Application/Competition/CompetitionCategory/Dto/CompetitionCategoryDto.cs @@ -0,0 +1,9 @@ +using Abp.Application.Services.Dto; + +namespace SystemKonkursow.Competition.CompetitionCategory.Dto +{ + public class CompetitionCategoryDto : EntityDto + { + public string Name { get; set; } + } +} diff --git a/SystemKonkursow/4.2.1/aspnet-core/src/SystemKonkursow.Application/Competition/CompetitionCategory/Dto/CompetitionCategoryMapProfile.cs b/SystemKonkursow/4.2.1/aspnet-core/src/SystemKonkursow.Application/Competition/CompetitionCategory/Dto/CompetitionCategoryMapProfile.cs new file mode 100644 index 0000000..1604ae5 --- /dev/null +++ b/SystemKonkursow/4.2.1/aspnet-core/src/SystemKonkursow.Application/Competition/CompetitionCategory/Dto/CompetitionCategoryMapProfile.cs @@ -0,0 +1,12 @@ +using AutoMapper; + +namespace SystemKonkursow.Competition.CompetitionCategory.Dto +{ + public class CompetitionCategoryMapProfile : Profile + { + public CompetitionCategoryMapProfile() + { + CreateMap(); + } + } +}