Saving Custom Data

You can use ObjectManager from any code with a reference to Graffiti.Core. ObjectManager to store your object in the current database, regardless of database type, as long as it can be serialized.

[Serializable]
public class MyObject
{
   private string _name;
   private string _description;
   public string Name
   {
       get { return _name; }
       set { _name = value; }
   }
   public string Description
   {
       get { return _description; }
       set { _description = value; }
   }
}

Make an instance of your object, and then call ObjectManager.Save().
MyObject obj = new MyObject();

ObjectManager.Save(obj, "KeyName");
Retrieve your object later by calling ObjectManager.Get().
ObjectManager.Get<MyObject>("KeyName");

Last edited Mar 31, 2010 at 5:04 AM by jkillebrew, version 1

Comments

No comments yet.