void ValidateTenantTags(OctopusRepository repository) { if (TenantTags == null || !TenantTags.Any()) { return; } var tagSets = repository.TagSets.FindAll(); var missingTags = TenantTags.Where(tt => !tagSets.Any(ts => ts.Tags.Any(t => t.CanonicalTagName.Equals(tt, StringComparison.OrdinalIgnoreCase)))).ToList(); if (missingTags.Any()) { throw new ArgumentException($"Could not find the {"tag" + (missingTags.Count == 1 ? "" : "s")} {string.Join(", ", missingTags)} on the Octopus server."); } }
void ValidateTenantTags(IOctopusSpaceRepository repository) { if (TenantTags == null || !TenantTags.Any()) { return; } var tagSets = repository.TagSets.FindAll(); var missingTags = TenantTags.Where(tt => !tagSets.Any(ts => ts.Tags.Any(t => t.CanonicalTagName.Equals(tt, StringComparison.OrdinalIgnoreCase)))).ToList(); if (missingTags.Any()) { throw new ArgumentException(CouldNotFindMessage("tag", missingTags.ToArray())); } }
async Task ValidateTenantTags(IOctopusSpaceAsyncRepository repository) { if (TenantTags == null || !TenantTags.Any()) { return; } var tagSets = await repository.TagSets.FindAll().ConfigureAwait(false); var missingTags = TenantTags.Where(tt => !tagSets.Any(ts => ts.Tags.Any(t => t.CanonicalTagName.Equals(tt, StringComparison.OrdinalIgnoreCase)))).ToList(); if (missingTags.Any()) { throw new InvalidRegistrationArgumentsException(CouldNotFindMessage("tag", missingTags.ToArray())); } }