Write the specified number of records in the array to the Stream.
True if the operation is successful. False otherwise.
This method only uses the stream and don't close them after use it, you must do it.
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.WriteStream Overload List