using System; using System.Collections.Generic; using System.Linq; namespace FlexFramework.Excel { public sealed class TableMapper : TableMapperBase>, IGenerator, ITableGenerator where T : new() { public TableMapper() : base(typeof(T)) { } protected override object CreateInstance() { return new T(); } T IGenerator.Instantiate(Row row) { return (T)Instantiate(row); } IEnumerable ITableGenerator.Instantiate(Table table) { return table.Where((r, i) => !excludes.Contains(i)).Select(row => (T)Instantiate(row)); } } public sealed class TableMapper : TableMapperBase, IGenerator, ITableGenerator { public TableMapper(Type type) : base(type) { } object IGenerator.Instantiate(Row row) { return Instantiate(row); } IEnumerable ITableGenerator.Instantiate(Table table) { return table.Where((r, i) => !excludes.Contains(i)).Select(row => Instantiate(row)); } } }