Click or drag to resize

MasterDetailEngineTMaster, TDetail Class

One of the main classes of the library.

This engine is responsible for reading and writing Master-Details records to or from files or streams.

[Missing <include> target documentation in 'T:FileHelpers.MasterDetail.MasterDetailEngine`2'. File: 'Examples.xml' Path: 'doc/examples/MasterDetailEngine/*']

Inheritance Hierarchy
SystemObject
  FileHelpersEngineBase
    FileHelpers.MasterDetailMasterDetailEngineTMaster, TDetail
      FileHelpers.MasterDetailMasterDetailEngine

Namespace:  FileHelpers.MasterDetail
Assembly:  FileHelpers (in FileHelpers.dll) Version: 3.2.6
Syntax
public class MasterDetailEngine<TMaster, TDetail> : EngineBase
where TMaster : class
where TDetail : class

Type Parameters

TMaster
The Master Record Type
TDetail
The Detail Record Type

The MasterDetailEngineTMaster, TDetail type exposes the following members.

Constructors
  NameDescription
Public methodMasterDetailEngineTMaster, TDetail
Initializes a new instance of the MasterDetailEngineTMaster, TDetail class
Public methodMasterDetailEngineTMaster, TDetail(MasterDetailSelector)
Initializes a new instance of the MasterDetailEngineTMaster, TDetail class
Public methodMasterDetailEngineTMaster, TDetail(CommonSelector, String)
Initializes a new instance of the MasterDetailEngineTMaster, TDetail class
Top
Properties
  NameDescription
Public propertyEncoding
The encoding to Read and Write the streams. Default is the system's current ANSI code page.
(Inherited from EngineBase.)
Public propertyErrorManager
This is a common class that manages the errors of the library.
(Inherited from EngineBase.)
Public propertyErrorMode
Indicates the behavior of the engine when it finds an error. {Shortcut for )
(Inherited from EngineBase.)
Public propertyFooterText
The Read Footer in the last Read operation. If any.
(Inherited from EngineBase.)
Public propertyHeaderText
The Read Header in the last Read operation. If any.
(Inherited from EngineBase.)
Public propertyLineNumber
The current line number.
(Inherited from EngineBase.)
Public propertyMasterOptions
Allows you to change some record layout options at runtime
Public propertyMasterType
the type of the master records handled by this engine.
Public propertyNewLineForWrite
Newline string to be used when engine writes to file. Default is the system's newline setting (System.Environment.NewLine).
(Inherited from EngineBase.)
Public propertyOptions
Allows you to change some record layout options at runtime
(Inherited from EngineBase.)
Public propertyRecordSelector
The MasterDetailSelector to get the RecordAction (only for read operations)
Public propertyRecordType
Returns the type of records handled by this engine.
(Inherited from EngineBase.)
Public propertyTotalRecords
The total numbers of records in the last read/written file (only works with whole read/write).
(Inherited from EngineBase.)
Top
Methods
  NameDescription
Public methodCode exampleAppendToFile(String, MasterDetailsTMaster, TDetail)
Append a record to the specified file.
Public methodCode exampleAppendToFile(String, IEnumerableMasterDetailsTMaster, TDetail)
Append an array of records to the specified file.
Public methodGetFileHeader
Builds a line with the name of the fields, for a delimited files it uses the same delimiter, for a fixed length field it writes the fields names separated with tabs
(Inherited from EngineBase.)
Public methodCode exampleReadFile
Read a file and return an array of the contained records.
Public methodCode exampleReadStream
Read a Stream and return an array of the contained records.
Public methodReadString
Read a String and return an array of the contained records.
Public methodCode exampleWriteFile(String, IEnumerableMasterDetailsTMaster, TDetail)
Write an array of records to the specified file.
Public methodCode exampleWriteFile(String, IEnumerableMasterDetailsTMaster, TDetail, Int32)
Write the specified number of records from the array to a file.
Public methodCode exampleWriteStream(TextWriter, IEnumerableMasterDetailsTMaster, TDetail)
Write an array of records to the specified Stream.
Public methodCode exampleWriteStream(TextWriter, IEnumerableMasterDetailsTMaster, TDetail, Int32)
Write the specified number of records in the array to the Stream.
Public methodWriteString(IEnumerableMasterDetailsTMaster, TDetail)
Write an array of records to an String and return it.
Public methodWriteString(IEnumerableMasterDetailsTMaster, TDetail, Int32)
Write an array of records to an String and return it.
Top
Events
  NameDescription
Public eventProgress
Event handler called to notify progress.
(Inherited from EngineBase.)
Top
Remarks

You can set the ErrorMode of this class to defined how to handle an error. Errors can be retrieved with the Errors property if set appropriately.

See in the Class Diagram and in the Quick Start Guide for more Info.

Or you can browse the Examples Section for more code.

See Also