mbraceproject / FsPickler

A fast multi-format message serializer for .NET
http://mbraceproject.github.io/FsPickler/
MIT License
323 stars 54 forks source link

Any idea to support obj type or dynimac object? #104

Open darting opened 6 years ago

darting commented 6 years ago

Lets say, I have a type

type Event<'State> = {
    ID : string    
    State : 'State
    CreatedTime : DateTime
}

And after I pickler.PickleToString then I store to database. I have another service load event data from database and do aggregation. But the problem is, I dont know what will be the exactly type of the State (and I dont use it in this case also). Is there any way just ignore the type?

I tried pickler.UnPickleOfString<Event<obj>> not working.

Thanks

eiriktsarpalis commented 6 years ago

Let me first say that using this library for storing data is not recommended. You can achieve what you need be serializing and deserializing using obj as your type parameter, however this will only work provided you have also serialized using obj.

darting commented 6 years ago

Ah thanks @eiriktsarpalis

Any recommend lib for serialize and store data to database? Newtonsoft Json.NET?