示例#1
0
        public IMigrationService Create(string platform)
        {
            switch (platform.ToLower())
            {
            case SUPPORTED_DATABASES.SQLSERVER:
            {
                var dataService       = new SqlServerDataService(_traceService);
                var bulkImportService = new SqlServerBulkImportService(_traceService);
                return(Create(dataService, bulkImportService));
            }

            case SUPPORTED_DATABASES.POSTGRESQL:
            {
                var dataService       = new PostgreSqlDataService(_traceService);
                var bulkImportService = new PostgreSqlBulkImportService(_traceService);
                return(Create(dataService, bulkImportService));
            }

            case SUPPORTED_DATABASES.MYSQL:
            {
                var dataService       = new MySqlDataService(_traceService);
                var bulkImportService = new MySqlBulkImportService(_traceService);
                return(Create(dataService, bulkImportService));
            }

            default:
                throw new NotSupportedException($"The target database platform {platform} is not supported or plugins location was not correctly configured. " +
                                                $"See WIKI for supported database platforms and usage guide.");
            }
        }
示例#2
0
        /// <summary>
        /// Create instance of <see cref="IMigrationService"/> with default support for SQL Server.
        /// </summary>
        public IMigrationService Create()
        {
            var dataService       = new SqlServerDataService(_traceService);
            var bulkImportService = new SqlServerBulkImportService(_traceService);

            return(CreateInternal(dataService, bulkImportService));
        }