I have a list of products in a table on db. I got them on a single page with this code:
public ActionResult Index() {
var products = productsRepository.GetAll();
IEnumerable<Models.Product> productsView = products.Select(p => new Models.Product() {
Id = p.Id,
Category = p.Category.Name,
Brand = p.Brand,
Name = p.Name,
Type = p.Type,
IsActive = p.IsActive,
SellPrice = p.SellPrice,
AddedDate = p.AddedDate
});
return View(productsView);
}
How should i get 'n' products per page and have multiple pages ? Ty