I'm seeing a very strange problem when overriding an abstract method and trying to call the base class's method that I'm currently overriding.
//In Dll "A"
namespace Rhino.Etl.Core.Operations
{
using System;
using System.Collections;
using System.Collections.Generic;
public class Row {}
public interface IOperation
{
IEnumerable<Row> Execute(IEnumerable<Row> rows);
}
public abstract class AbstractOperation : IOperation
{
public abstract IEnumerable<Row> Execute(IEnumerable<Row> rows);
}
public abstract class AbstractDatabaseOperation : AbstractOperation
{
}
public abstract class SqlBulkInsertOperation : AbstractDatabaseOperation
{
public override IEnumerable<Row> Execute(IEnumerable<Row> rows)
{
Console.WriteLine("SqlBulkInsertOperation");
return rows;
}
}
}
//In console app "B"
namespace MyStuff
{
using System;
using System.Collections;
using System.Collections.Generic;
class Program
{
static void Main(string[] args)
{
ActualEtlOperation e = new ActualEtlOperation();
e.Execute(new Row[0]);
Console.ReadLine();
}
}
public abstract class SqlBulkInsertWithTruncateOperation : SqlBulkInsertOperation
{
public override IEnumerable<Row> Execute(IEnumerable<Row> rows)
{
Console.WriteLine("Truncate");
base.Execute(rows);
return rows;
}
}
public class ActualEtlOperation : SqlBulkInsertWithTruncateOperation
{
}
}
Basically, the SqlBulkInsertOperation does not do what I need it to do, so I need to do a little work before and after I call Execute(rows) on it by overriding it. But the code in SqlBulkInsertOperation.Execute(Rows) is not executed.
When running this code in the debugger in Visual Studio the debugger the code's not executed. When I hover the mouse over "base" in the Visual Studio editor it knows the base class is of type SqlBulkInsertOperation.
What am I missing?