Esempio n. 1
0
 public ISet <InstallationDto> GetAll()
 => _installationCore.GetAll()
 .Select(_RunIntegration)
 .Select(integrationResult =>
 {
     if (integrationResult.IsLeft)
     {
         _logger.LogWarning($"Integration result was a failure and will be skipped in result set = {integrationResult.GetLeft}");
     }
     return(integrationResult);
 })
 .Where(integrationResult => integrationResult.IsRight)
 .Select(integrationResult => integrationResult.Get)
 .ToHashSet();
 // TODO return either
 public ISet <InstallationDto> GetAll()
 => _core.GetAll()
 .Select(Either <InstallationError, InstallationDto> .Right <InstallationError, InstallationDto>)
 .Select(RunIntegration)
 .Where(it =>
 {
     if (it.IsLeft)
     {
         // TODO info which failed through error
         _logger.LogWarning("Integration result was a failure and will be skipped in result set.");
     }
     return(it.IsRight);
 })
 .Select(it => it.Get)
 .ToHashSet();