Skip to content

Instantly share code, notes, and snippets.

@yetanotherchris
Last active December 13, 2015 18:59
Show Gist options
  • Save yetanotherchris/4959811 to your computer and use it in GitHub Desktop.
Save yetanotherchris/4959811 to your computer and use it in GitHub Desktop.
ORMS: Persistor.NET Express example
[Serializable]
public class Person
{
public Guid Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
}
public class PersonManager
{
public static void Example()
{
// Doesn't require app.config/web.config settings
Persistor persistor = new Persistor();
// Save example
Person person = new Person();
person.Id = Guid.NewGuid();
person.Name = "John";
person.Email = "john@aol.com";
persistor.Save(person);
// A simple load
IList<Person> list = persistor.Retrieve<Person>();
// Filtered loading
list = persistor.Retrieve<Person>( delegate(Person p){ return p.Name == "John" } );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment