Exemple #1
0
        private void AssignDestination()
        {
            bool vTest =
                Destinations.Any
                (
                    r =>
                    r.Key.Equals
                    (
                        AppSettingsValues.PushToDestination
                        , StringComparison.OrdinalIgnoreCase
                    )
                );

            NoOp = !vTest || NoOp;
            if (vTest)
            {
                KeyValuePair <string, List <NuGetRepository> > vDestination =
                    Destinations.FirstOrDefault
                    (
                        r =>
                        r.Key.Equals
                        (
                            AppSettingsValues.PushToDestination
                            , StringComparison.OrdinalIgnoreCase
                        )
                    );
                SelectedDestination.DestinationName = vDestination.Key;
                SelectedDestination.Repositories    = vDestination.Value;
            }
            else
            {
                ErrorContainer.Errors.Add
                    ($"Invalid destination: {AppSettingsValues.PushToDestination}");
                throw new Exception("Invalid configuration.");
            }
        }