using System.Collections.Generic;
public static void Main()
MyDatabase myDatabase = new MyDatabase();
myDatabase.Groups.Insert(new Group { Name = "Group 1" });
myDatabase.Groups.Insert(new Group { Name = "Group 2" });
myDatabase.Groups.Insert(new Group { Name = "Group 3" });
myDatabase.Groups.Delete(new Group() { Id = 1 });
FiddleHelper.WriteTable("1 - All Groups",myDatabase.Groups.ToList());
myDatabase.Groups.ToList().ForEach(x => myDatabase.Groups.Delete(x));
FiddleHelper.WriteTable("2 - All Groups",myDatabase.Groups.ToList());
public class MyDatabase : Database
var members = this.Tables.Create<Member, int>(x => x.Id, new IdentitySpecification<Member>(x => x.Id, 1, 1));
var groups = base.Tables.Create<Group, int>(g => g.Id, new IdentitySpecification<Group>(x => x.Id, 1, 1));
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; }