public DataService ToDataService(string flowId, string modifiedById, DateTime modifiedOn)
        {
            ExecutableInfo executableInfo = null;

            if (!string.IsNullOrEmpty(PluginImplementerString))
            {
                executableInfo = new ExecutableInfo(PluginImplementerString);
            }
            DataService dataService =
                new DataService(Name, flowId, IsActive, EnumUtils.ParseEnum <ServiceType>(ServiceType),
                                executableInfo, EnumUtils.ParseEnum <DataServicePublishFlags>(PublishFlags));

            dataService.ModifiedById = modifiedById;
            dataService.ModifiedOn   = modifiedOn;
            Dictionary <string, DataProviderInfo> dataSources = null;

            CollectionUtils.ForEach(DataSources, delegate(KeyedDataSourceSetting dataSource)
            {
                DataProviderInfo dataProviderInfo = dataSource.ToDataProviderInfo(modifiedById, modifiedOn);
                CollectionUtils.Add(dataSource.Key, dataProviderInfo, ref dataSources);
            });
            dataService.DataSources = (dataSources == null) ? null : dataSources;
            Dictionary <string, string> args = null;

            CollectionUtils.ForEach(Args, delegate(KeyValueSetting setting)
            {
                CollectionUtils.Add(setting.Key, setting.Value, ref args);
            });
            dataService.Args = (args == null) ? null : args;
            return(dataService);
        }
Esempio n. 2
0
 public DataService(string name, string flowId, bool isActive, ServiceType serviceType, ExecutableInfo pluginInfo,
                    DataServicePublishFlags publishFlags)
 {
     _name         = name;
     _flowId       = flowId;
     _isActive     = isActive;
     _type         = serviceType;
     _pluginInfo   = pluginInfo;
     _publishFlags = publishFlags;
     _args         = new Dictionary <string, string>();
     _dataSources  = new Dictionary <string, DataProviderInfo>();
 }