コード例 #1
0
        /// <summary>
        /// Gets a file engine.
        /// </summary>
        /// <typeparam name="TEntity">The type of record.</typeparam>
        /// <param name="engineFactory">The engine factory.</param>
        /// <param name="handleEntryReadError">The error handler.</param>
        /// <returns>A new file engine.</returns>
        public static IFlatFileEngine GetEngine <TEntity>(
            this IFlatFileEngineFactory <IDelimitedLayoutDescriptor, IDelimitedFieldSettingsContainer> engineFactory,
            FileReadErrorHandler?handleEntryReadError = null)
            where TEntity : class, new()
        {
            var descriptorProvider = new DelimitedLayoutDescriptorProvider();
            var descriptor         = descriptorProvider.GetDescriptor <TEntity>();

            return(engineFactory.GetEngine(descriptor, handleEntryReadError));
        }
コード例 #2
0
        /// <summary>
        /// Gets the engine.
        /// </summary>
        /// <typeparam name="TEntity">The type of the t entity.</typeparam>
        /// <param name="engineFactory">The engine factory.</param>
        /// <param name="handleEntryReadError">The handle entry read error.</param>
        /// <returns>IFlatFileEngine.</returns>
        public static IFlatFileEngine GetEngine <TEntity>(
            this IFlatFileEngineFactory <ILayoutDescriptor <IFixedFieldSettingsContainer>, IFixedFieldSettingsContainer> engineFactory,
            Func <string, Exception, bool> handleEntryReadError = null)
            where TEntity : class, new()
        {
            var descriptorProvider = new FixedLayoutDescriptorProvider();

            var descriptor = descriptorProvider.GetDescriptor <TEntity>();

            return(engineFactory.GetEngine(descriptor, handleEntryReadError));
        }
コード例 #3
0
 public FixedLengthAttributeMappingIntegrationTests()
 {
     fileEngineFactory = new FixedLengthFileEngineFactory();
 }
コード例 #4
0
 public DelimitedAttriubteMappingIntegrationTests()
 {
     _fileEngineFactory = new DelimitedFileEngineFactory();
 }
コード例 #5
0
 public DelimitedAttributeMappingIntegrationTests()
 {
     _fileEngineFactory = new DelimitedFileEngineFactory();
 }
コード例 #6
0
 public FixedLengthAttributeMappingIntegrationTests() { fileEngineFactory = new FixedLengthFileEngineFactory(); }