コード例 #1
0
        private void UpdateOwners(UpdateDistribution command, Distribution distribution)
        {
            (IList <User> addedOwners, IList <User> removedOwners) =
                collectionsComparer
                .Compare(distribution.Owners, command.Owners);

            distribution.AddOwners(addedOwners);
            distribution.RemoveOwners(removedOwners);
        }
コード例 #2
0
        private void UpdateTags(Build build, UpdateBuildTags command)
        {
            (IList <string> newTags, IList <string> tagsToDelete) =
                collectionsComparer
                .Compare(build.Tags, command.Tags);

            if (!newTags.Any() && !tagsToDelete.Any())
            {
                return;
            }

            foreach (string tag in tagsToDelete)
            {
                build.RemoveTag(tag);
            }

            foreach (string newTag in newTags)
            {
                build.AddTag(newTag);
            }

            build.UpdateArtifactState(ArtifactState.Updated);
        }