public static void Main()
MyDatabase myDatabase = new MyDatabase();
myDatabase.Groups.Insert(new Group() { Id = 1});
myDatabase.Groups.Insert(new Group() { Id = 2});
myDatabase.Members.Insert(new Member() { Id = 1, GroupId = 1, Name = "It's Member_1" });
myDatabase.Members.Insert(new Member() { Id = 2, Name = "It's Member_2" });
myDatabase.Groups.Delete(new Group { Id = 1 });
var list = myDatabase.Members.Where(x => Functions.Like(x.Name, "%Member_2%")).ToList();
FiddleHelper.WriteTable("Members",list);
myDatabase.Members.Insert(new Member() { Id = 3, GroupId = 2, Name = "It's Member_3" });
FiddleHelper.WriteTable("All Members",myDatabase.Members.ToList());
public class MyDatabase : Database
var members = this.Tables.Create<Member, int>(x => x.Id);
var groups = base.Tables.Create<Group, int>(g => g.Id);
RelationOptions options = new RelationOptions(
var peopleGroupIdIndex = members.CreateIndex(
new RedBlackTreeIndexFactory(),
this.Tables.CreateRelation(
public ITable<Member> Members { get; private set; }
public ITable<Group> Groups { get; private set; }
public int Id { get; set; }
public string Name { get; set; }
public int? GroupId { get; set; }
public int Id { get; set; }
public string Name { get; set; }