Exemplo n.º 1
0
        protected virtual void Generate([NotNull] MigrationOperation operation, [NotNull] IndentedStringBuilder builder)
        {
            Check.NotNull(operation, nameof(operation));
            Check.NotNull(builder, nameof(builder));

            throw new InvalidOperationException(DesignCoreStrings.UnknownOperation(operation.GetType()));
        }
        protected override void Generate([NotNull] MigrationOperation operation, [NotNull] IndentedStringBuilder builder)
        {
            Check.NotNull(operation, nameof(operation));
            Check.NotNull(builder, nameof(builder));

            var asCreateExtensionOperation = operation as NpgsqlCreatePostgresExtensionOperation;

            if (asCreateExtensionOperation != null)
            {
                Generate(asCreateExtensionOperation, builder);
                return;
            }

            var asDropExtensionOperation = operation as NpgsqlDropPostgresExtensionOperation;

            if (asDropExtensionOperation != null)
            {
                Generate(asDropExtensionOperation, builder);
                return;
            }

            throw new InvalidOperationException(DesignCoreStrings.UnknownOperation(operation.GetType()));
        }