public void Handle(FileUploaded msg) { using (var file = File.OpenRead(msg.Filename)) using (StreamReader reader = new StreamReader(file)) { int row = 0; string line; while ((line = reader.ReadLine()) != null) { var values = line.Split(new [] { ',' }); var report = new AbideReport { TradeId = values[0], ActionType = values[1], OtherStuff = values[2] }; Context.Parent.Tell(new NewAbideReport { Filename = msg.Filename, Row = row++, Report = report }); } } Context.Parent.Tell(new EndOfFile { Filename = msg.Filename }); }
protected ReportedActionCommand(AbideReport report) { AggregateId = report.TradeId; }
public abstract ReportedActionCommand GetCommand(AbideReport report);
public UnrecognizedCommand(AbideReport report) : base(report) { }
public override ReportedActionCommand GetCommand(AbideReport report) { return(new NewCommand(report)); }
public ModifyCommand(AbideReport report) : base(report) { }
public ImplicitPositionCommand(AbideReport report) : base(report) { }
public override ReportedActionCommand GetCommand(AbideReport report) { return(new UnrecognizedCommand(report)); }
public CompressCommand(AbideReport report) : base(report) { }
public NewCommand(AbideReport report) : base(report) { SomeData = report.OtherStuff; }
public override ReportedActionCommand GetCommand(AbideReport report) { return(new ImplicitPositionCommand(report)); }