public IDictionary Execute()

in SamplesV1/DeleteBlobFileFolderCustomActivity/DeleteFromBlobActivity.cs [17:63]


        public IDictionary<string, string> Execute(IEnumerable<LinkedService> linkedServices,
                                                   IEnumerable<Dataset> datasets,
                                                   Activity activity,
                                                   IActivityLogger logger)
        {
            try
            {
                logger.Write("Custom Activity Started.");

                DotNetActivity dotNetActivity = (DotNetActivity)activity.TypeProperties;
                string inputToDelete = dotNetActivity.ExtendedProperties["InputToDelete"];
                logger.Write("\nInput to delete is " + inputToDelete);

                logger.Write("\nAll Dataset(s) Below " );
                foreach (Dataset ds in datasets)
                {
                    logger.Write("\nDataset: " + ds.Name);
                }

                foreach (string name in activity.Inputs.Select(i => i.Name))
                {
                    logger.Write("\nInput Dataset: " + name);
                }

                foreach (string name in activity.Outputs.Select(i => i.Name))
                {
                    logger.Write("\nOutput Dataset: " + name);
                }

                List<string> dataSetsToDelete = inputToDelete.Split(',').ToList();

                DeleteBlobFileFolder(dataSetsToDelete);

                logger.Write("Custom Activity Ended Successfully.");
            }
            catch (Exception e)
            {
                logger.Write("Custom Activity Failed with error.");
                logger.Write("Caught exception: ");
                logger.Write(e.Message);
                throw new Exception(e.Message);
            }

            // The dictionary can be used to chain custom activities together in the future.
            // This feature is not implemented yet, so just return an empty dictionary.
            return new Dictionary<string, string>();
        }