ForLogic.Prevalence
Examples

Example 01 - Storing an Object
This example creates an "User" object and stores it in ForLogic.Prevalence. We're only going to save it. If you want to know how to retrieve this object back, see the Example02.

using System;
using ForLogic.Prevalence;

namespace Example01 {

	//class of the objects that will be stored
	[Serializable]
	public class User: IPersistentObject {
		private long _id;
		private string _name;
		public User(string name) {
			_name = name;
		}
		public long Id {
			get{return _id;}
			set{_id = value;}
		}
		public string Name {
			get{return _name;}
			set{_name = value;}
		}
	}
	
	//main application
	public class MyApplication {
		[STAThread]
		public static void Main(string[] args) {
			User user = new User("The User Name");
			Prevalence.start("data", 15); //starts ForLogic.Prevalence
			Prevalence.save(user); //saves the object
		}
	}
	
}