Просмотр исходного кода

Fixed bug

feature/1593_selection_process_BE
Safet Purkovic 3 лет назад
Родитель
Сommit
5c18812563

+ 1
- 1
Diligent.WebAPI.Business/Services/Interfaces/ISelectionLevelService.cs Просмотреть файл

public interface ISelectionLevelService public interface ISelectionLevelService
{ {
Task<List<SelectionLevelResponseWithDataDto>> GetAllAsync(); Task<List<SelectionLevelResponseWithDataDto>> GetAllAsync();
Task<SelectionProcessResposneDto> GetByIdAsync(int id);
Task<SelectionLevelResposneDto> GetByIdAsync(int id);
} }
} }

+ 2
- 2
Diligent.WebAPI.Business/Services/SelectionLevelService.cs Просмотреть файл

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);


} }
} }

+ 1
- 2
Diligent.WebAPI.Contracts/DTOs/SelectionLevel/SelectionLevelResponseWithDataDto.cs Просмотреть файл

{ {
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; }
} }

+ 1
- 1
Diligent.WebAPI.Contracts/DTOs/SelectionLevel/SelectionLevelResposneDto.cs Просмотреть файл

{ {
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; }
} }

+ 1
- 1
Diligent.WebAPI.Contracts/DTOs/SelectionProcess/SelectionProcessResposneDto.cs Просмотреть файл

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; }
} }
} }

+ 1
- 0
Diligent.WebAPI.Data/Entities/SelectionProcess.cs Просмотреть файл

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; }
} }
} }

Загрузка…
Отмена
Сохранить