public static ICollection <IMigrationExpression> GetCreateColumnWithSystemMethodExpression(string schemaName = null)
        {
            var context = new MigrationContext(null, null, null, null);
            var expr    = new CreateColumnExpression
            {
                TableName  = TestTableName1,
                SchemaName = schemaName,
                Column     = new ColumnDefinition {
                    Name = TestColumnName1, Type = DbType.String, Size = 5
                }
            };

            context.Expressions.Add(expr);
            var builder = new CreateColumnExpressionBuilder(expr, context);

            builder.SetExistingRowsTo(SystemMethods.CurrentDateTime);
            return(context.Expressions);
        }
Esempio n. 2
0
        public static ICollection <IMigrationExpression> GetCreateColumnWithSystemMethodExpression(string schemaName = null)
        {
            var serviceProvider = new ServiceCollection().BuildServiceProvider();
            var querySchema     = new Mock <IQuerySchema>();
            var context         = new MigrationContext(querySchema.Object, serviceProvider, null, null);
            var expr            = new CreateColumnExpression
            {
                TableName  = TestTableName1,
                SchemaName = schemaName,
                Column     = new ColumnDefinition {
                    Name = TestColumnName1, Type = DbType.DateTime
                }
            };

            context.Expressions.Add(expr);
            var builder = new CreateColumnExpressionBuilder(expr, context);

            builder.SetExistingRowsTo(SystemMethods.CurrentDateTime);
            return(context.Expressions);
        }