This project is read-only.

IndexedList Documentation :


Is summery you can see the usage below, for more details please see the above links :
public class Person
{
    public long Id { get; set; }
    public string Name { get; set; }
    public string Family { get; set; }
    public string NationalNo { get; set; }
    public DateTime BirthDate { get; set; }
}

DBEntities ent = new DBEntities();

//Declare IndexedList
IndexedList<Person> People = ent.People.ToIndexList();

//Adding Index to list
People.AddUniqueIndex(p=> p.Id);
People.AddUniqueIndex(p=> p.NationalNo);
People.AddIndex("Idx_1", p=> new {p.Name, p.Family });
People.AddIndex("Idx_2", p=> new {p.Family, p.BirthDate });
People.AddIndex("Idx_3", p=> new {p.Name, p.BirthDate });
People.AddIndex(p=> new {p.Name, p.BirthDate });

DateTime birthdate = new DateTime(1970,5,7);

//Using IndexedList to find items rapidly
var result = people.Find(p => p.Name == "Alex" && p.Family == "Mahoon");

var result1 = people.Find("Alex", "Mahoon");

var result2 = people.FindUsingIndex("Idx_2", "Mahoon", birthdate);

var result3 = people.FindUsingIndex("Idx_3", new Person() {BirthDate= birthdate, Name= "Alex"});

var result4 = people.FindSingle((long)1001);

var result5 = people.FindSingle("23439008-2");

var result6 = people.FindSingleUsingIndex("NationalNo", "23439008-2");

Last edited Oct 15, 2013 at 3:05 PM by Basir_ansary, version 7