コード例 #1
0
        public void SaveGlobalConfiguration(PluginConfigurationEntity globalConfiguration)
        {
            if (!GlobalConfigurationRepository.Entities.Any())
                GlobalConfigurationRepository.Insert(new GlobalConfiguration());
            var configuration = GlobalConfigurationRepository.Entities.First();

            Mapper.Map(globalConfiguration, configuration);
            GlobalConfigurationRepository.Update(configuration);
        }
コード例 #2
0
        public void SaveGlobalConfiguration(PluginConfigurationEntity globalConfiguration)
        {
            if (!GlobalConfigurationRepository.Entities.Any())
                GlobalConfigurationRepository.Insert(new GlobalConfiguration());
            var configuration = GlobalConfigurationRepository.Entities.First();

            Mapper.Map(globalConfiguration, configuration);
            GlobalConfigurationRepository.Update(configuration);

            var jenkinsServers = JenkinsServerConfigurationRepository
                .GetAllSatisfiedBy(x => x.GlobalConfigurationId == configuration.GlobalConfigurationId)
                .ToArray();

            UpdateCollectionHelper.UpdateCollection(jenkinsServers, globalConfiguration.JenkinsServers,
                JenkinsServerConfigurationRepository, Mapper,
                (d, b) => d.Name == b.Name,
                d => d.GlobalConfigurationId = configuration.GlobalConfigurationId);
        }