Home
Manage Your Code
Snippet: FetachAll Paged SubSonic Controller Method (C#)
Title: FetachAll Paged SubSonic Controller Method Language: C#
Description: Performs a pages fetch all using SubSonic Views: 283
Author: Kevin Isom Date Added: 11/20/2007
Copy Code  
1[DataObjectMethod( DataObjectMethodType.Select, false )]
2public MyCollection FetchAllPaged(int start, int pageLength)
3{
4	int startIndex;
5
6	if(start <= 1)
7	{
8		startIndex = 1;
9	}
10	else
11	{
12		startIndex = start / pageLength + 1;
13	}
14	Query qry = new Query( My.Schema );
15	qry.PageSize = pageLength;
16	qry.PageIndex = startIndex;
17	return FetchByQuery(qry);
18 }
19public int FetchAllCount()
20{
21	Query qry = new Query( [Schema] );
22	return qry.GetCount( [Columns] );
23}