Append an array of records to the specified file.
True if the operation is successful. False otherwise.
This method open, seek ends, write and close the file (don't open or close the file before or after to call this method)
You need to define a Selector Method too:
RecordAction ExampleSelector(string record)
{
if (Char.IsLetter(record[0]))
return RecordAction.Master;
else
return RecordAction.Detail;
}
Finally you must to instanciate a MasterDetailEngine and Read/Write files: MaterDetailEngine engine = new MaterDetailEngine(typeof(Customers), typeof(Orders), new MasterDetailSelector(ExampleSelector));
// to Read use:
MasterDetail[] res = engine.ReadFile("TestIn.txt");
// to Write use:
engine.WriteFile("TestOut.txt", res);
MasterDetailEngine Class | FileHelpers.MasterDetail Namespace | MasterDetailEngine.AppendToFile Overload List