/// <summary>
        /// Creates an object that can be used to configure the mapping from an entity to a flat file record
        /// and write the given entities to the file.
        /// </summary>
        /// <typeparam name="TEntity">The type of the entity whose properties will be mapped.</typeparam>
        /// <param name="entities">The entities that will be written to the file.</param>
        /// <returns>The configuration object.</returns>
        public static ISeparatedValueTypeWriter <TEntity> DefineWriter <TEntity>(IEnumerable <TEntity> entities)
        {
            if (entities == null)
            {
                throw new ArgumentNullException("entities");
            }
            var mapper = new SeparatedValueTypeMapper <TEntity>(() => Activator.CreateInstance <TEntity>());

            return(new SeparatedValueTypeWriter <TEntity>(mapper, entities));
        }
 public SeparatedValueTypeWriter(SeparatedValueTypeMapper <TEntity> mapper, IEnumerable <TEntity> entities)
 {
     this.mapper   = mapper;
     this.entities = entities;
 }