private async Task <int?> CheckEducationFieldsAsync(string firstName, string secondName, int?firstId, int?secondId) { if (secondId == firstId) { return(secondId); } else { var spec = await _educationService?.GetByIdAsync(secondId); var placeStudy = await _educationService?.GetByIdAsync(firstId); if (spec != null && spec.PlaceOfStudy == firstName) { return(spec.ID); } else if (placeStudy != null && placeStudy.Speciality == secondName) { return(placeStudy.ID); } else { return(null); } } }
public async Task <IActionResult> Get(Guid id) { var education = await _educationService.GetByIdAsync(id); if (education != null) { return(Ok(education)); } else { return(NotFound()); } }