Skip to content

v2.0

Choose a tag to compare

@mcavigelli mcavigelli released this 26 Sep 15:01
· 1395 commits to master since this release

The library has passed its 1st birthday !!! and thanks to the work and contribution of a lot of people (partial list of them) Too many things were changed, mostly internally, now we have a performance gain of more than 60% in .NET 2.0 I will be releasing the version for .NET 1.1 because I know that a lot of people use it in some corporations, but maybe in the next releases the new features will be .net 2.0 only. It's a massive job maintain and optimize both =( versions There are also a lot of major changes, refactoring in the code, and a big core rewrite that allow the engines to use less memory and temporary string (we are using more buffers to avoid this) We were very busy to keep to library updated and to give support to the users. Check the forums for any problems as it's likely they have been addressed here. We have our own domain www.filehelpers.com thanks to (Antoine) and a DevBlog. Here do you have all the stuff that keep me busy for a while :P

Breaking Changes

  • The constructor of the MultiRecordEngine was changed to allow params args, and to allow users to not pass the RecordSelector (in write operations where it was not needed).
  • EndsRead and EndsWrite deleted, now you have a Close() operation to simplify the API and to make it similar to the System.Data namespace. (The async engines also implement IDisposable).
  • Rename FileHelperException --> FileHelpers Exception a better name =) and an easy to solve problem.
  • By default the numeric fields in the FixedLengthRecords that don't have an [FieldAlign] will be aligned to the right and the rest the left by default, with this we avoid the problem of generate files with different meaning when reading and writing.

Performance related

  • Internal use of Reflection.Emit, Dynamic Methods and char buffers to get more than 50% enhancement in performance and for .NET 2.0 more than 65%
  • The Read..AsDT methods now creates the DataTable record by record, not at the end, so you can handle large files without any memory overload
  • No more reflection in the operations (only in the constructors).
  • FieldSorter faster too, Removed REFLECTION for EMIT

Shining new features

  • The very cool DelimitedFileEngine and FixedFileEngine that allow to change options at RunTime (also with generic versions) Check an example here
  • ConditionalRecords you can easily include or exclude certain records based on a RecordCondition (like BeginsWith, EndsWith, Contains or RegEx) Check the example
  • A new GenericDatabaseStorage to allow databases use ADO.NET to work with the FileHelpers (Thanks Rodolfo Finochietti)
  • Experimental Mono project Support (some users are already using it, we hope that in the next release we have a completely working version for this framework)
  • New version checker in the demos and wizard (both with a renewed look and feel) Check the movies
  • .NET 2.0 Nullable Types support. (Thanks Vijayan) Check the example
  • Notification Interfaces: you can now get notified of the events simply implement them
  • Enhanced Debugging in .NET 2.0 with DebuggerDisplay and DebuggerBrowsable, DebugVisualizars to come.
  • The wizard has a record class test that allows you to introduce sample data and your class and check for errors or results.
  • You can check our screencasts for the demos, wizard and other features of the library.
  • Now the code for Vs2003 and Vs2005 are both on SVN, sharing the same files and the build script autodetect your Visual Studio installation. So no more excuses time to get involved =)
  • The engines with asynchronous operations are now IDisposable and IEnumerable so you can declare it with using(..) and use them in a foreach loop

API changes and extensions

  • The write methods are less strict. You can pass now an IEnumerable instead of an array, so you can directly pass a List or ArrayList to the method without doing a ToArray()
  • RunTime records can now get a DataTable in the constructor and use DataColumns to create one field for each column.
  • Generic versions of near all the engines of the library (it is really hard to maintain the two copies :P so everyone it is time to port !!)
  • Asynchronous operations in others engines like the MultiRecordEngine
  • Event support to the MultiRecordEngine thanks to the contribution of Francis de Fouchier
  • The library now handles infinite levels of inheritance adding the high level fields first in the result record class.
  • Allow to ignore spaces and tabs in the IgnoreEmptyLinesAttribute
  • IgnoreCommentedLines thanks to MCampbell
  • The Read methods now have a maxRecords args to tell to the engines how much them must read.
  • A new constructor overload to the engine that allow to pass the Encoding. This is useful to make the users aware of the Encoding feature.
  • FileTransformEngine with two new methods ReadAndTransformRecords and TransformRecords
  • Flush method to AsyncEngines to allow users to ensure data is written. For example, if they are using the library for logging.
  • The converters are now smarter as they validate to which types can be assigned and throw exceptions if converter is wrong (for example if you use ConverterKind.Decimal in a int field)
  • The ConvertException has a lot of context information: LineNumber, ColumnNumber, FieldName. Also better exception messages.
  • The integer converters receive now take a decimal separator to build an InvariantCulture to format and parse the values and strings

Small changes

  • Fixed the problem with ASP.NET: "Line 0: Metadata file 'filehelpers.dll' could not be found"
  • Fixed some problems with the CsvClassBuilder (it is a good practice to not to release the last minute added features)
  • The assemblies are now signed
  • The new ConverterBase.DefaultDateTimeFormat to avoid set the converter format field by field =)
  • Some error messages from the library were rewritten and now provides more contextual information (line and column numbers, field name, etc).
  • ExcelStorage supports more than 26 columns (thanks to Mark Izendooren)
  • Encoding support to the CsvEngine
  • The wizard remembers all the paths now
  • SkipThisRecord in the AfterReadRecordEventArgs, this allows engine to skip records from the results (thanks Crestline)
  • More methods for the CommonEngine
  • More than 420+ NUnit tests !!! (I cant believe it, I'm a lazy developer but I know how much value you get out of testing the library)
  • You now have two versions for the demos, one for each framework version.
  • The FixedLengthClassBuilder has more constructors to set the length of the fields in your instruction
  • Improved documentation. (Thanks Antoine and Matt)
  • A lot of new examples check it out !!