jamescourtney / FlatSharp

Fast, idiomatic C# implementation of Flatbuffers
Apache License 2.0
510 stars 51 forks source link

Serialization in V7 #404

Closed robjakedorsett closed 1 year ago

robjakedorsett commented 1 year ago

Hi, I was using V6. Where my workflow was to create a table structure in c# i.e.:

Then I would use the FlatBufferSerializer.Default.Parse<TableTest>(data) method to deserialize, this worked very well.

    [FlatBufferTable]
    public class TableTest
    {
        [FlatBufferItem(1)]
        public string PropertyOne { get; set; }

        [FlatBufferItem(2)]
        public string PropertyTwo { get; set; }
    }

This now, no longer exists (FlatBufferSerializer.Default.Parse).

I've checked the docs, which suggests using this: TableTest tt = TableTest.Serializer.Parse(data); Ofcourse, this .Serializer prop, doesn't exist, is there something I am missing?

I'd ideally like to avoid having to generate from fbs files.

jamescourtney commented 1 year ago

Sorry to be the bearer of bad news, but reflection mode is no longer supported in V7. There are a lot of reasons for this change that are best documented here. FBS files are the way forward. I'm happy to help you make the transition if you need support.