/// <summary> /// Used to read a file as a DataTable without instantiating the engine.<br /> /// <b>This method has limited features. We recommend using the non static methods.</b> /// </summary> /// <param name="recordClass">The record class.</param> /// <param name="fileName">The file name</param> /// <param name="maxRecords">The max number of records to read. Int32.MaxValue or -1 to read all records.</param> /// <returns>The DataTable representing all the read records.</returns> public static DataTable ReadFileAsDT(Type recordClass, string fileName, int maxRecords) { var engine = new FileHelperEngine(recordClass); #pragma warning disable 618 return(engine.ReadFileAsDT(fileName, maxRecords)); #pragma warning restore 618 }
/// <summary> /// Used to read a file as a DataTable without instantiating the engine.<br /> /// <b>This method has limited features. We recommend using the non static methods.</b> /// </summary> /// <param name="recordClass">The record class.</param> /// <param name="fileName">The file name</param> /// <param name="maxRecords">The max number of records to read. Int32.MaxValue or -1 to read all records.</param> /// <returns>The DataTable representing all the read records.</returns> public static DataTable ReadFileAsDT(Type recordClass, string fileName, int maxRecords) { var engine = new FileHelperEngine(recordClass); return(engine.ReadFileAsDT(fileName, maxRecords)); }