mgravell / fast-member

Automatically exported from code.google.com/p/fast-member
Apache License 2.0
1.02k stars 137 forks source link

ObjectReader throws ArgumentOutOfRangeException when creating with list of primitive types #39

Open spencermayne opened 7 years ago

spencermayne commented 7 years ago

`using System.Data; using FastMember;

namespace ConsoleApp1 { public class Program { static void Main(string[] args) { var ints = new long [10]; for (int i = 0; i < 10; i++) { ints[i] = i; }

        var dt = new DataTable();
        using (var reader = ObjectReader.Create(ints))
        {
            dt.Load(reader);
        }
    }
}

}`

Error information:

If I wrap the array of ints in my own object, it works fine. I have also tried this with string[] and long[]

spencermayne commented 7 years ago

Just seen the code formatting, please excuse that :/