Exemplo n.º 1
0
        /// <summary>
        /// Create an orchestrator on the server database (to have an existing schema) and getting a table schema
        /// </summary>
        /// <returns></returns>
        private static async Task GetTableSchemaAsync()
        {
            var provider     = new SqlSyncProvider(serverConnectionString);
            var options      = new SyncOptions();
            var setup        = new SyncSetup(new string[] { "ProductCategory", "ProductModel", "Product" });
            var orchestrator = new RemoteOrchestrator(provider, options, setup);

            // working on the product Table
            var productSetupTable = setup.Tables["Product"];

            // Getting the table schema
            var productTable = await orchestrator.GetTableSchemaAsync(productSetupTable);

            foreach (var column in productTable.Columns)
            {
                Console.WriteLine(column);
            }
        }