I am trying to modify functionality of the standard CSVDestinationProvider (in specific naming of the output file).
what i'm doing is:
class ExtendedCsvDestinationWriter : CsvDestinationWriter
{
private readonly string _path;
private TextWriter _writer;
protected override TextWriter Writer
{
get
{
if (_writer == null)
{
_writer = new StreamWriter(_path + "/" +
Mapping.DestinationTable.Name + DateTime.Now.ToString("yyyyMMddHHmm") + ".csv");
}
return _writer;
}
set { _writer = value; }
}
}
this doesn't work since the get/set methods aren't overrideable, but what i'm trying to do should be clear.
Is there a way i can make this work without having to recreate all of the logic in CsvDestinationProvider and CsvDestinationWriter?
Note that the only change from the standard functionality is to ad a timestamp to the name of the file.