public void Execute(string typeName, string[] constructorArguments)
        {
            DebugCheck.NotEmpty(typeName);

            var manipulator = new ConfigFileManipulator();
            var processor = new ConfigFileProcessor();

            new ConfigFileFinder().FindConfigFiles(
                Project.ProjectItems,
                i => processor.ProcessConfigFile(
                    i, new Func<XDocument, bool>[]
                        {
                            c => manipulator.AddOrUpdateConfigSection(c, GetType().Assembly.GetName().Version),
                            c => manipulator.AddOrUpdateConnectionFactoryInConfig(
                                c, new ConnectionFactorySpecification(typeName, constructorArguments))
                        }));
        }
Exemple #2
0
        public void Execute(string invariantName, string typeName)
        {
            DebugCheck.NotEmpty(invariantName);
            DebugCheck.NotEmpty(typeName);

            var manipulator = new ConfigFileManipulator();
            var processor   = new ConfigFileProcessor();

            new ConfigFileFinder().FindConfigFiles(
                Project.ProjectItems,
                i => processor.ProcessConfigFile(
                    i, new Func <XDocument, bool>[]
            {
                c => manipulator.AddOrUpdateConfigSection(c, GetType().Assembly.GetName().Version),
                c => manipulator.AddProviderToConfig(c, invariantName, typeName)
            }));
        }
        public void Execute(string typeName, string[] constructorArguments)
        {
            DebugCheck.NotEmpty(typeName);

            var manipulator = new ConfigFileManipulator();
            var processor   = new ConfigFileProcessor();

            new ConfigFileFinder().FindConfigFiles(
                Project.ProjectItems,
                i => processor.ProcessConfigFile(
                    i, new Func <XDocument, bool>[]
            {
                c => manipulator.AddOrUpdateConfigSection(c, GetType().Assembly.GetName().Version),
                c => manipulator.AddOrUpdateConnectionFactoryInConfig(
                    c, new ConnectionFactorySpecification(typeName, constructorArguments))
            }));
        }
        public void Execute(string invariantName, string typeName)
        {
            DebugCheck.NotEmpty(invariantName);
            DebugCheck.NotEmpty(typeName);

            var manipulator = new ConfigFileManipulator();
            var processor = new ConfigFileProcessor();

            new ConfigFileFinder().FindConfigFiles(
                Project.ProjectItems,
                i => processor.ProcessConfigFile(
                    i, new Func<XDocument, bool>[]
                        {
                            c => manipulator.AddOrUpdateConfigSection(c, GetType().Assembly.GetName().Version),
                            c => manipulator.AddProviderToConfig(c, invariantName, typeName)
                        }));
        }
        public SqlCompactConnectionFactoryConfigurator(Project project)
        {
            DebugCheck.NotNull(project);

            var manipulator = new ConfigFileManipulator();
            var processor   = new ConfigFileProcessor();

            new ConfigFileFinder().FindConfigFiles(
                project.ProjectItems,
                i => processor.ProcessConfigFile(
                    i, new Func <XDocument, bool>[]
            {
                c => manipulator.AddOrUpdateConnectionFactoryInConfig(
                    c,
                    new ConnectionFactorySpecification(
                        ConnectionFactorySpecification.SqlCeConnectionFactoryName,
                        ConnectionFactorySpecification.SqlCompactProviderName))
            }));
        }
        public SqlCompactConnectionFactoryConfigurator(Project project)
        {
            Contract.Requires(project != null);

            var manipulator = new ConfigFileManipulator();
            var processor = new ConfigFileProcessor();

            new ConfigFileFinder().FindConfigFiles(
                project.ProjectItems,
                i => processor.ProcessConfigFile(
                    i, new Func<XDocument, bool>[]
                           {
                               c => manipulator.AddOrUpdateConnectionFactoryInConfig(
                                   c,
                                   new ConnectionFactorySpecification(
                                        ConnectionFactorySpecification.SqlCeConnectionFactoryName,
                                        ConnectionFactorySpecification.SqlCompactProviderName))
                           }));
        }
        public void Execute()
        {
            using (
                var detector = new SqlServerDetector(
                    Registry.LocalMachine, new ServiceControllerProxy(new ServiceController("MSSQL$SQLEXPRESS"))))
            {
                var factorySpecification = detector.BuildConnectionFactorySpecification();
                var manipulator = new ConfigFileManipulator();
                var processor = new ConfigFileProcessor();

                new ConfigFileFinder().FindConfigFiles(
                    Project.ProjectItems,
                    i => processor.ProcessConfigFile(
                        i, new Func<XDocument, bool>[]
                            {
                                c => manipulator.AddOrUpdateConfigSection(c, GetType().Assembly.GetName().Version),
                                c => manipulator.AddConnectionFactoryToConfig(c, factorySpecification)
                            }));
            }

            new ReferenceRemover(Project).TryRemoveSystemDataEntity();
        }
        public void Execute()
        {
            using (
                var detector = new SqlServerDetector(
                    Registry.LocalMachine, new ServiceControllerProxy(new ServiceController("MSSQL$SQLEXPRESS"))))
            {
                var factorySpecification = detector.BuildConnectionFactorySpecification();
                var manipulator          = new ConfigFileManipulator();
                var processor            = new ConfigFileProcessor();

                new ConfigFileFinder().FindConfigFiles(
                    Project.ProjectItems,
                    i => processor.ProcessConfigFile(
                        i, new Func <XDocument, bool>[]
                {
                    c => manipulator.AddOrUpdateConfigSection(c, GetType().Assembly.GetName().Version),
                    c => manipulator.AddConnectionFactoryToConfig(c, factorySpecification)
                }));
            }

            new ReferenceRemover(Project).TryRemoveSystemDataEntity();
        }
Exemple #9
0
        public ConnectionFactoryConfigurator(Project project)
        {
            Check.NotNull(project, "project");

            using (
                var detector = new SqlServerDetector(
                    Registry.LocalMachine, new ServiceControllerProxy(new ServiceController("MSSQL$SQLEXPRESS"))))
            {
                var factorySpecification = detector.BuildConnectionFactorySpecification();
                var manipulator          = new ConfigFileManipulator();
                var processor            = new ConfigFileProcessor();

                new ConfigFileFinder().FindConfigFiles(
                    project.ProjectItems,
                    i => processor.ProcessConfigFile(
                        i, new Func <XDocument, bool>[]
                {
                    c => manipulator.AddOrUpdateConfigSection(c, GetType().Assembly.GetName().Version),
                    c => manipulator.AddConnectionFactoryToConfig(c, factorySpecification)
                }));
            }
        }
        public ConnectionFactoryConfigurator(Project project)
        {
            Check.NotNull(project, "project");

            using (
                var detector = new SqlServerDetector(
                    Registry.LocalMachine, new ServiceControllerProxy(new ServiceController("MSSQL$SQLEXPRESS"))))
            {
                var factorySpecification = detector.BuildConnectionFactorySpecification();
                var manipulator = new ConfigFileManipulator();
                var processor = new ConfigFileProcessor();

                new ConfigFileFinder().FindConfigFiles(
                    project.ProjectItems,
                    i => processor.ProcessConfigFile(
                        i, new Func<XDocument, bool>[]
                               {
                                   c => manipulator.AddOrUpdateConfigSection(c, GetType().Assembly.GetName().Version),
                                   c => manipulator.AddConnectionFactoryToConfig(c, factorySpecification)
                               }));
            }
        }
        public ConnectionFactoryConfigurator(Project project)
        {
            Contract.Requires(project != null);

            using (
                var detector = new SqlServerDetector(
                    Registry.LocalMachine, new ServiceControllerProxy(new ServiceController("MSSQL$SQLEXPRESS"))))
            {
                var factorySpecification = detector.BuildConnectionFactorySpecification();
                var manipulator = new ConfigFileManipulator();
                var processor = new ConfigFileProcessor();
                var efVersion = new VersionMapper().GetEntityFrameworkVersion(project);

                new ConfigFileFinder().FindConfigFiles(
                    project.ProjectItems,
                    i => processor.ProcessConfigFile(
                        i, new Func<XDocument, bool>[]
                               {
                                   c => manipulator.AddOrUpdateConfigSection(c, efVersion),
                                   c => manipulator.AddConnectionFactoryToConfig(c, factorySpecification)
                               }));
            }
        }