This project has moved and is read-only. For the latest updates, please go here.

Additional index structures can be created for the tables. There are multiple types of index structures (and developers are allowed to create their own), so an index factory instance has to be specified. The indexed fields are set with a lambda expression. The following example shows how to create an index on the group foreign key of the Person entity.

public class MyDatabase : Database
    public MyDatabase()
        var peopleTable = base.Tables.Create<Person, int>(p => p.Id);

        var peopleGroupIdIndex = peopleTable.CreateIndex(
            new RedBlackTreeIndexFactory<Person>(), 
            p => p.GroupId);

        this.People = peopleTable;

    public ITable<Person> People { get; private set; }

Last edited Nov 10 at 6:25 AM by zzzprojects, version 5


Mario_1 Jul 17, 2014 at 7:56 AM 
Hi, how to create an index on multiple fields, e.g. Name and BirthDay of the Person entity?