diff --git a/DotNetDBF.Enumerable/Enumerable.cs b/DotNetDBF.Enumerable/Enumerable.cs
index 8642dd9..4a8b8eb 100644
--- a/DotNetDBF.Enumerable/Enumerable.cs
+++ b/DotNetDBF.Enumerable/Enumerable.cs
@@ -169,8 +169,9 @@ public static void AddRecord(this DBFWriter writer, Enumerable.IDBFInterceptor v
///
/// The reader.
/// The prototype. Anonymous class instance
+ /// Indicates if parsing error throws an exception. Default: true
///
- public static IEnumerable AllRecords(this DBFReader reader, T prototype = null) where T : class
+ public static IEnumerable AllRecords(this DBFReader reader, T prototype = null, bool throwOnParsingError = true) where T : class
{
var tType = typeof(T);
@@ -194,25 +195,25 @@ public static IEnumerable AllRecords(this DBFReader reader, T prototype =
if (tType.GetCustomAttributes(typeof(CompilerGeneratedAttribute), false).Any())
{
- var tAnon = reader.NextRecord(tProps, tOrderedProps);
+ var tAnon = reader.NextRecord(tProps, tOrderedProps, throwOnParsingError);
while (tAnon != null)
{
tReturn.Add((T) Activator.CreateInstance(tType, tAnon));
- tAnon = reader.NextRecord(tProps, tOrderedProps);
+ tAnon = reader.NextRecord(tProps, tOrderedProps, throwOnParsingError);
}
return tReturn;
}
- var t = reader.NextRecord(tProps, tOrderedProps);
+ var t = reader.NextRecord(tProps, tOrderedProps, throwOnParsingError);
while (t != null)
{
var interceptor = new Enumerable.DBFInterceptor(t, tProperties.Select(it => it.Name).ToArray());
tReturn.Add(interceptor.ActLike(typeof(Enumerable.IDBFInterceptor)));
- t = reader.NextRecord(tProps, tOrderedProps);
+ t = reader.NextRecord(tProps, tOrderedProps, throwOnParsingError);
}
@@ -225,9 +226,10 @@ public static IEnumerable AllRecords(this DBFReader reader, T prototype =
/// The reader.
/// The where column name.
/// What the were column should equal.
+ /// Indicates if parsing error throws an exception. Default: true
///
public static IEnumerable DynamicAllRecords(this DBFReader reader, string whereColumn = null,
- dynamic whereColumnEquals = null)
+ dynamic whereColumnEquals = null, bool throwOnParsingError = true)
{
var props = reader.GetSelectFields().Select(it => it.Name).ToArray();
@@ -240,7 +242,7 @@ public static IEnumerable DynamicAllRecords(this DBFReader reader, stri
var tReturn = new List