コード例 #1
0
        private static string GetSqlBySQLServer(DataTable table)
        {
            SQLServer.SqlInsertBuilder sql = new SQLServer.SqlInsertBuilder(table.Name);
            foreach (var field in table.Fields)
            {
                if (field.IsAdditional)
                {
                    continue;                     //附加字段由数据映射器维护
                }
                sql.AddField(field.Name);
            }

            if (table.IsSnapshot && table.Type == DataTableType.AggregateRoot)
            {
                sql.AddField("SnapshotTime");
                sql.AddField("SnapshotLifespan");
            }

            if (table.IsEnabledMultiTenancy)
            {
                sql.AddField(GeneratedField.TenantIdName);
            }

            return(sql.GetCommandText());
        }
コード例 #2
0
        private static string GetSqlBySQLServer(DataTable table)
        {
            SQLServer.SqlInsertBuilder sql = new SQLServer.SqlInsertBuilder(table.Name);
            foreach (var field in table.Fields)
            {
                sql.AddField(field.Name);
            }

            if (table.IsSnapshot && table.Type == DataTableType.AggregateRoot)
            {
                sql.AddField("SnapshotTime");
                sql.AddField("SnapshotLifespan");
            }

            return(sql.GetCommandText());
        }