/// <summary> /// Reads a record using the input formatter if required. /// </summary> /// <param name="reader">the reader to read from</param> /// <returns>the read record</returns> private T ReadRecord(IRecordReader <T> reader) { var record = reader.Read(); return(InputFormatter == null || record == null ? record : InputFormatter.Format(record)); }