public async Task UpdateExpertAreasAsync(long expertId) { var expert = await _expertRepository.GetByIdAsync(expertId) ?? throw new AppErrorException(ErrorCode.ExpertNotFound); var areas = await _expertsRegistryContractClient.GetExpertAreasAsync(expert.User.Address); if (!areas.Any()) { await RemoveExpertAsync(expert); } else { expert.SetAreas(areas); await _expertRepository.SaveChangesAsync(); } }
public Task <Expert> GetByIdAsync(long expertId) => _expertRepository.GetByIdAsync(expertId);