public ISet <InstallationDto> GetAllNearby(InstallationGetAllNearbyCommand command) => _installationIntegration.GetInstallationsNearby(command) .PeekLeft(integrationFailure => { _logger.LogWarning($"Integration failure = {integrationFailure}"); }) .Map(CreateOrUpdateBatch) .GetOrElse(new HashSet <InstallationDto>());
// TODO return either public ISet <InstallationDto> GetAllNearby(InstallationGetAllNearbyCommand command) => _integration.GetInstallationsNearby(command) // TODO createBatch .Map(installations => { return(installations.Select(CreateInstallation) .Where(it => { if (it.IsLeft) { // TODO info which failed through error _logger.LogWarning("Core result was a failure and will be skipped in result set."); } return it.IsRight; }) .Select(it => it.Get) .ToHashSet()); }) .GetOrElse(new HashSet <InstallationDto>());