This project is read-only.

Project Description

    F2Enum is a library that convert flat files to CLR Objects.

  • It's support conversion from strings to primary types (int , int? ,bool, bool? , Datetime) and Complex type
  • It's support Formatting Dates

    The Library contains two Classes :

  • The MapperClass : To define The mapping between Flat File and the properties of the Mapped Class.

  • The F2EnumLibrary Class : to Call the static method ConvertToEnumerable

To define The Mapping :
List<MapperClass<TestClass>> mappings = new List<MapperClass<TestClass>>();
mappings.Add(new MapperClass<TestClass>(e => e.TestClass1.TestClass1.TestClass1.Champ1, 1, 10));
mappings.Add(new MapperClass<TestClass>(e => e.TestClass1.TestClass1.Champ2, 1, 10));
And Then Call The Method like Below :
IEnumerable<TestClass> testEnumerable = F2EnumLibrary.ConvertToEnumerable("Data\\Test.Txt",mappings);


Note : the Release 1.2 include a new method that let you do actions after the creation of each instance instead of returning a IEnumerable.

F2EnumLibrary.ConvertToObjectsWidthActions("Data\\Test.Txt", mappings, (t) => { Interlocked.Increment(ref i); } );


Last edited Jul 26, 2011 at 4:22 PM by bbennoun, version 14