private async Task <int?> CheckWorkFieldsAsync(string firstName, string secondName, int?firstId, int?secondId) { if (secondId == firstId) { return(secondId); } else { var placeOfWork = await _workService?.GetByIdAsync(firstId); var position = await _workService?.GetByIdAsync(secondId); if (position != null && position.PlaceOfwork == firstName) { return(position.ID); } else if (placeOfWork != null && placeOfWork.Position == secondName) { return(placeOfWork.ID); } else { return(null); } } }
public async Task <ActionResult <WorkDTO> > GetID(long id) { var detail = await _workService.GetByIdAsync(id); return(Ok(detail)); }