| public interface ISelectionLevelService | public interface ISelectionLevelService | ||||
| { | { | ||||
| Task<List<SelectionLevelResponseWithDataDto>> GetAllAsync(); | Task<List<SelectionLevelResponseWithDataDto>> GetAllAsync(); | ||||
| Task<SelectionProcessResposneDto> GetByIdAsync(int id); | |||||
| Task<SelectionLevelResposneDto> GetByIdAsync(int id); | |||||
| } | } | ||||
| } | } |
| public async Task<List<SelectionLevelResponseWithDataDto>> GetAllAsync() => | public async Task<List<SelectionLevelResponseWithDataDto>> GetAllAsync() => | ||||
| _mapper.Map<List<SelectionLevelResponseWithDataDto>>(await _context.SelectionLevels.Include(sl => sl.SelectionProcesses).ToListAsync()); | _mapper.Map<List<SelectionLevelResponseWithDataDto>>(await _context.SelectionLevels.Include(sl => sl.SelectionProcesses).ToListAsync()); | ||||
| public async Task<SelectionProcessResposneDto> GetByIdAsync(int id) | |||||
| public async Task<SelectionLevelResposneDto> GetByIdAsync(int id) | |||||
| { | { | ||||
| var sl = await _context.SelectionLevels.FindAsync(id); | var sl = await _context.SelectionLevels.FindAsync(id); | ||||
| if (sl is null) | if (sl is null) | ||||
| throw new EntityNotFoundException("Selection level not found"); | throw new EntityNotFoundException("Selection level not found"); | ||||
| return _mapper.Map<SelectionProcessResposneDto>(sl); | |||||
| return _mapper.Map<SelectionLevelResposneDto>(sl); | |||||
| } | } | ||||
| } | } |
| { | { | ||||
| public class SelectionLevelResponseWithDataDto | public class SelectionLevelResponseWithDataDto | ||||
| { | { | ||||
| public int LevelId { get; set; } | |||||
| public int Id { get; set; } | |||||
| public string Name { get; set; } | public string Name { get; set; } | ||||
| public SelectionProcessResposneDto SelectionProcesses { get; set; } | public SelectionProcessResposneDto SelectionProcesses { get; set; } | ||||
| } | } |
| { | { | ||||
| public class SelectionLevelResposneDto | public class SelectionLevelResposneDto | ||||
| { | { | ||||
| public int LevelId { get; set; } | |||||
| public int Id { get; set; } | |||||
| public string Name { get; set; } | public string Name { get; set; } | ||||
| } | } |
| public string Status { get; set; } | public string Status { get; set; } | ||||
| public DateTime? Date { get; set; } | public DateTime? Date { get; set; } | ||||
| public string? Link { get; set; } | public string? Link { get; set; } | ||||
| public ApplicantViewDto Applicant { get; set; } | |||||
| //public ApplicantViewDto Applicant { get; set; } | |||||
| } | } | ||||
| } | } |
| public int SelectionLevelId { get; set; } | public int SelectionLevelId { get; set; } | ||||
| public SelectionLevel SelectionLevel { get; set; } | public SelectionLevel SelectionLevel { get; set; } | ||||
| public int ApplicantId { get; set; } | public int ApplicantId { get; set; } | ||||
| public Applicant Applicant { get; set; } | |||||
| } | } | ||||
| } | } |