Ejemplo n.º 1
0
        public PackageSource GetPackageSourceFor(DeployUnit deployUnit)
        {
            var matchingPackageSources = PackageSources.Where(x => x.Name == deployUnit.PackageInfo.Source).ToList();

            if (matchingPackageSources.Count == 0)
            {
                throw new ConfigurationErrorsException($"The package source {deployUnit.PackageInfo.Source}, used by the deploy unit {deployUnit.Name}, does not exist");
            }
            if (matchingPackageSources.Count > 1)
            {
                throw new ConfigurationErrorsException($"The package source {deployUnit.PackageInfo.Source}, used by the deploy unit {deployUnit.Name}, is declared more than once.");
            }
            return(matchingPackageSources.Single());
        }