Exemple #1
0
        protected override void DoRun(IShellContext context)
        {
            var model = GetModel(context);
            var sqlModel = new DataSyncSqlModel(model, context, true, context.Replace(GetProviderString(context)));

            var connection = GetConnectionProvider(context);
            using (var conn = connection.Connect())
            {
                var sqlconn = conn as SqlConnection;
                if (sqlconn != null)
                {
                    sqlconn.InfoMessage += (s, e) =>
                    {
                        foreach (SqlError error in e.Errors)
                        {
                            context.OutputMessage(error.Message);
                        }
                    };
                }
                sqlModel.Run(conn, connection.Factory, context, UseTransaction, sqlModel.Parameters, GetParameterValues(context));
            }
        }