Beispiel #1
0
 public FixedLengthResult(IFixedLengthTypeMapper <T> mapper, IEnumerable <T> data, FixedLengthOptions options = null, string fileName = null, string contentType = null)
 {
     if (mapper == null)
     {
         throw new ArgumentNullException("mapper");
     }
     if (data == null)
     {
         throw new ArgumentNullException("data");
     }
     if (options == null)
     {
         options = new FixedLengthOptions();
     }
     if (String.IsNullOrWhiteSpace(fileName))
     {
         fileName = "file.txt";
     }
     if (contentType == null)
     {
         contentType = "text/plain";
     }
     this.writer      = mapper.ToWriter(data);
     this.options     = options;
     this.fileName    = fileName;
     this.contentType = contentType;
 }
Beispiel #2
0
 public FixedLengthComplexPropertyMapping(IFixedLengthTypeMapper <TEntity> mapper, IMemberAccessor member, int fileIndex, int workIndex)
 {
     this.mapper     = mapper;
     this.Member     = member;
     this.columnName = member.Name;
     this.FileIndex  = fileIndex;
     this.WorkIndex  = workIndex;
 }
 public FixedLengthComplexPropertyMapping(
     IFixedLengthTypeMapper <TEntity> mapper,
     IMemberAccessor member,
     int physicalIndex,
     int logicalIndex)
 {
     this.mapper   = mapper;
     Member        = member;
     columnName    = member.Name;
     PhysicalIndex = physicalIndex;
     LogicalIndex  = logicalIndex;
 }
 /// <summary>
 /// Provides the schema to use by default when no other matches are found.
 /// </summary>
 /// <param name="typeMapper">The default type mapper to use.</param>
 public void WithDefault <TEntity>(IFixedLengthTypeMapper <TEntity> typeMapper)
 {
     WithDefault((IDynamicFixedLengthTypeMapper)typeMapper);
 }
 public FixedWidthDataSource()
 {
     Mapper = (IFixedLengthTypeMapper <FixedWidthRecordT>)Configuration;
 }
Beispiel #6
0
 public FixedLengthComplexPropertyMapping(IFixedLengthTypeMapper <TEntity> mapper, PropertyInfo property)
 {
     this.mapper     = mapper;
     this.property   = property;
     this.columnName = property.Name;
 }
Beispiel #7
0
            public void Use <TEntity>(IFixedLengthTypeMapper <TEntity> typeMapper)
            {
                var dynamicMapper = (IDynamicFixedLengthTypeMapper)typeMapper;

                Use(dynamicMapper);
            }
 /// <summary>
 /// Provides the schema to use by default when no other matches are found.
 /// </summary>
 /// <param name="typeMapper">The default type mapper to use.</param>
 /// <returns>The current selector to allow for further customization.</returns>
 public void WithDefault <TEntity>(IFixedLengthTypeMapper <TEntity> typeMapper)
 {
     this.defaultMapper = (IDynamicFixedLengthTypeMapper)typeMapper;
 }