public static void Main(string[] args) { using (IObjectContainer container = CreateDB()) { // #example: Store the non storable type container.Store(new NonStorableType("TestData")); // #end example } using (IObjectContainer container = CreateDB()) { // #example: Load the non storable type NonStorableType data = container.Query <NonStorableType>()[0]; // #end example Console.Out.WriteLine(data.Data); } }
// This is called when the object is activated public void OnActivate(IObjectContainer objectContainer, object targetObject, object storedObject) { NonStorableType notStorable = (NonStorableType)targetObject; notStorable.Data = (String)storedObject; }
// This is called to store the object public object OnStore(IObjectContainer objectContainer, object objToStore) { NonStorableType notStorable = (NonStorableType)objToStore; return(notStorable.Data); }