Click here to Skip to main content
15,792,608 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Problem consuming soap web service - content mismatch Pin
Richard Deeming18-Dec-17 3:40
mveRichard Deeming18-Dec-17 3:40 
GeneralRe: Problem consuming soap web service - content mismatch Pin
anto200518-Dec-17 6:44
anto200518-Dec-17 6:44 
GeneralRe: Problem consuming soap web service - content mismatch Pin
Richard Deeming18-Dec-17 7:34
mveRichard Deeming18-Dec-17 7:34 
QuestionHow to fix error "the type or namespace name 'CustomerBAL' could not be found (are you missing a using directive or an assembly reference) Pin
Member 1357490013-Dec-17 22:50
Member 1357490013-Dec-17 22:50 
AnswerRe: How to fix error "the type or namespace name 'CustomerBAL' could not be found (are you missing a using directive or an assembly reference) Pin
pt140113-Dec-17 23:00
pt140113-Dec-17 23:00 
GeneralRe: How to fix error "the type or namespace name 'CustomerBAL' could not be found (are you missing a using directive or an assembly reference) Pin
Member 1357490013-Dec-17 23:56
Member 1357490013-Dec-17 23:56 
QuestionHow to incorporate pagination feature into my repository Pin
Mou_kol13-Dec-17 4:31
Mou_kol13-Dec-17 4:31 
AnswerRe: How to incorporate pagination feature into my repository Pin
Richard Deeming13-Dec-17 8:17
mveRichard Deeming13-Dec-17 8:17 
Two obvious options:

1) Have GetBooks return IQueryable<Book>:
C#
public IQueryable<Book> GetBooks()
{
    return _context.Books;
}

...

int pageIndex = 2;
int pageSize = 20;
IEnumerable<Book> pageOfBooks = repository.GetBooks().Skip(pageIndex * pageSize).Take(pageSize).ToList();

Some people don't like that, because it exposes the underlying database to the next layer up. But it works.

2) Have overloads of GetBooks to take the paging details:
C#
public IEnumerable<Book> GetBooks()
{
    return _context.Books.ToList();
}

public IEnumerable<Book> GetBooks(int pageIndex, int pageSize)
{
    return _context.Books.Skip(pageIndex * pageSize).Take(pageSize).ToList();
}

...

int pageIndex = 2;
int pageSize = 20;
IEnumerable<Book> pageOfBooks = repository.GetBooks(pageIndex, pageSize);

This initially looks cleaner, but it doesn't let you sort the books before paging them.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: How to incorporate pagination feature into my repository Pin
Mou_kol14-Dec-17 21:33
Mou_kol14-Dec-17 21:33 
GeneralRe: How to incorporate pagination feature into my repository Pin
F-ES Sitecore14-Dec-17 23:56
professionalF-ES Sitecore14-Dec-17 23:56 
GeneralRe: How to incorporate pagination feature into my repository Pin
Richard Deeming18-Dec-17 2:47
mveRichard Deeming18-Dec-17 2:47 
GeneralRe: How to incorporate pagination feature into my repository Pin
Mou_kol18-Dec-17 21:49
Mou_kol18-Dec-17 21:49 
GeneralRe: How to incorporate pagination feature into my repository Pin
Richard Deeming19-Dec-17 2:59
mveRichard Deeming19-Dec-17 2:59 
QuestionAm I approaching this problem the wrong way? Pin
samflex11-Dec-17 6:25
samflex11-Dec-17 6:25 
AnswerRe: Am I approaching this problem the wrong way? Pin
jkirkerx13-Dec-17 10:53
professionaljkirkerx13-Dec-17 10:53 
QuestionHow to setup and use VSTS for five user Pin
Mou_kol8-Dec-17 0:19
Mou_kol8-Dec-17 0:19 
AnswerRe: How to setup and use VSTS for five user Pin
Richard MacCutchan8-Dec-17 1:05
mveRichard MacCutchan8-Dec-17 1:05 
QuestionVisual Studio Update 15.5.0 - MVC View editor comes up with just black text Pin
jkirkerx7-Dec-17 14:38
professionaljkirkerx7-Dec-17 14:38 
AnswerRe: Visual Studio Update 15.5.0 - MVC View editor comes up with just black text Pin
Richard Deeming8-Dec-17 2:28
mveRichard Deeming8-Dec-17 2:28 
GeneralRe: Visual Studio Update 15.5.0 - MVC View editor comes up with just black text Pin
jkirkerx8-Dec-17 7:20
professionaljkirkerx8-Dec-17 7:20 
AnswerRe: Visual Studio Update 15.5.0 - MVC View editor comes up with just black text Pin
jkirkerx10-Dec-17 11:33
professionaljkirkerx10-Dec-17 11:33 
QuestionConsuming a homemade rest service in asp.net webform Pin
wilcodk7-Dec-17 3:47
wilcodk7-Dec-17 3:47 
AnswerRe: Consuming a homemade rest service in asp.net webform Pin
Richard Deeming7-Dec-17 9:54
mveRichard Deeming7-Dec-17 9:54 
GeneralRe: Consuming a homemade rest service in asp.net webform Pin
wilcodk7-Dec-17 23:20
wilcodk7-Dec-17 23:20 
QuestionPopulating pdf on the server Pin
Michael Clinton6-Dec-17 8:49
Michael Clinton6-Dec-17 8:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.