示例#1
0
            public static T Create(ExcelDocument.Row row)
            {
                var result = FastFactory <T> .CreateInstance();

                foreach (var p in props)
                {
                    var col      = p.Key;
                    var data     = row[col]?.GetData();
                    var accessor = p.Value.Item2;
                    var pType    = Nullable.GetUnderlyingType(p.Value.Item1) ?? p.Value.Item1;
                    accessor.SetValue(result, Convert.ChangeType(data, pType));
                }

                return(result);
            }
示例#2
0
 public static T FromRow <T>(ExcelDocument.Row row) where T : new()
 {
     return(Implementor <T> .Create(row));
 }