Knight Data Access Layer
Loading Top
Basic Tasks C# > Loading Data > Loading Top

Load a limited number of records.

//Get the current instance of the helper

IDataHelper db = DataHelper.SessionFactory();

 

Dictionary<string,object> parameters = new Dictionary<string, object>();

parameters.Add("@FirstName", "Dan");

List<Person> list = db.LoadTop<Person>("WHERE FirstName = @FirstName", parameters, "ORDER BY LastName",1);