This project is read-only.

IPersistent bug i think

Sep 18, 2012 at 3:43 AM

I have implemented some classes that implement IPersistent because my class can't be xml serialized.  I am noticing that the IPersistent methods never get called and instead the xml version which is missing most of my data is saved.


I assumed if i used that interface the methods would be used to save the objects but maybe there is something else i need to do?

Sep 18, 2012 at 5:09 AM
Edited Sep 18, 2012 at 8:41 PM

Maybe you are not using the correct StoreFactory getter?.. FYI, here are sample snippets showing how to retrieve a Store with IPersistent entities on Key and/or Value:

// for string Key, IPersistent Value:

var storeWithPersistentValue = StoreFactory.GetPersistentValue<string, YourIPersistentImplementingClass>(...);

// for IPersistent Key, string Value:

var storeWithPersistentKey = StoreFactory.GetPersistentKey<YourIPersistentImplementingClass, string>(...);

// for IPersistent Key, IPersistent Value:

var storeWithPersistentKeyValue = StoreFactory.GetPersistent<YourIPersistentImplementingKeyClass, YourIPersistentImplementingValueClass>(...);


NOTE: in v4.7, StoreFactory.Get(...) should support all of above implicitly, so no need to bother understanding which one to use. v4.5 though has the above requirement. I hope above is useful & resolve the issue you've seen.