Question

I'm storing an Item in an in-memory Sqlite datastore using Ormlite's Db.Insert(item). The resulting array is null. Do I need to change the way I'm storing it or the way I'm retrieving it?

public class Item
{
    [AutoIncrement]
    public long Id { get; set; }

    public int[,] Numbers { get; set; }
}

public class Tester {

    void Test() {
        var item = new Item() { Numbers = new int[5,5] };

        item.Numbers[1,1] = 1234;

        using (var db = new ....) {

            db.Insert(item);

            var Id = db.LastInsertedId();

            var result = db.SingleById<Item>(Id);

            /*
            OUTPUT: 

             result.Numbers == null                                                  

            */
        }
    }

}
Was it helpful?

Solution

Multi-dimensional arrays aren't supported in ServiceStack, i.e. in OrmLite or its text Serializers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top