コード例 #1
0
        public virtual MigrationOperation GetInsertOperation(IHistoryRow row)
        {
            Check.NotNull(row, nameof(row));

            // TODO: Escape. Can we parameterize?
            return(new SqlOperation(
                       @"INSERT INTO [dbo].[__MigrationHistory] ([MigrationId], [ContextKey], [ProductVersion])
VALUES ('" + row.MigrationId + "', '" + _contextType.FullName + "', '" + row.ProductVersion + "')",
                       suppressTransaction: false));
        }
コード例 #2
0
 public virtual MigrationOperation GetInsertOperation(IHistoryRow row) => new SqlOperation
 {
     Sql = new IndentedStringBuilder().Append("INSERT INTO ")
           .Append(_sql.DelimitIdentifier(MigrationTableName))
           .Append(" (\"MigrationId\", \"ContextKey\", \"ProductVersion\") VALUES (")
           .Append($"'{_sql.EscapeLiteral(row.MigrationId)}', ")
           .Append($"'{_sql.EscapeLiteral(_contextKey)}', ")
           .Append($"'{_sql.EscapeLiteral(row.ProductVersion)}'")
           .Append(");")
           .ToString()
 };
コード例 #3
0
        public virtual MigrationOperation GetInsertOperation(IHistoryRow row)
        {
            Check.NotNull(row, nameof(row));

            return(new SqlOperation
            {
                Sql = new StringBuilder()
                      .AppendLine("INSERT INTO [dbo].[__MigrationHistory] ([MigrationId], [ContextKey], [ProductVersion])")
                      .Append("VALUES ('").Append(_sql.EscapeLiteral(row.MigrationId)).Append("', '")
                      .Append(_sql.EscapeLiteral(_contextType.FullName)).Append("', '")
                      .Append(_sql.EscapeLiteral(row.ProductVersion)).AppendLine("');")
                      .ToString()
            });
        }
コード例 #4
0
        public virtual MigrationOperation GetInsertOperation(IHistoryRow row)
        {
            Check.NotNull(row, nameof(row));

            return new SqlOperation
                {
                    Sql = new StringBuilder()
                        .AppendLine("INSERT INTO [dbo].[" + MigrationHistoryTableName + "] ([MigrationId], [ContextKey], [ProductVersion])")
                        .Append("VALUES ('").Append(_sql.EscapeLiteral(row.MigrationId)).Append("', '")
                        .Append(_sql.EscapeLiteral(_contextType.FullName)).Append("', '")
                        .Append(_sql.EscapeLiteral(row.ProductVersion)).AppendLine("');")
                        .ToString()
                };
        }
コード例 #5
0
 public MigrationOperation GetInsertOperation(IHistoryRow row) => null;
コード例 #6
0
 public virtual MigrationOperation GetInsertOperation(IHistoryRow row)
 {
     throw new NotImplementedException();
 }
コード例 #7
0
 public virtual MigrationOperation GetInsertOperation(IHistoryRow row)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
 public virtual MigrationOperation GetInsertOperation(IHistoryRow row) => new SqlOperation
 {
     Sql = new IndentedStringBuilder().Append("INSERT INTO ")
         .Append(_sql.DelimitIdentifier(MigrationTableName))
         .Append(" (\"MigrationId\", \"ContextKey\", \"ProductVersion\") VALUES (")
         .Append($"'{_sql.EscapeLiteral(row.MigrationId)}', ")
         .Append($"'{_sql.EscapeLiteral(_contextKey)}', ")
         .Append($"'{_sql.EscapeLiteral(row.ProductVersion)}'")
         .Append(");")
         .ToString()
 };