// GET: Home public ActionResult Index() { List <Inventory> inv = new List <Inventory>(); List <Inventory> itemp = _irepo.GetList(); List <BlogPost> btemp = _brepo.GetList(); List <BlogPost> SortedList = btemp.OrderByDescending(b => b.ID).ToList(); for (int i = 0; i < 5; i++) { inv.Add(itemp[i]); } HomePageModel model = new HomePageModel(); model.inventory = inv; model.blogs = SortedList; return(View(model)); }
public static List <Inventory> GetListByCategory(this IDataEntityRepository <Inventory> repo, Category category) { return(repo.GetList().Where(i => i.CategoryID.Equals(category.ID)).ToList()); }
public static List <BlogPost> GetListByContent(this IDataEntityRepository <BlogPost> repo, string str) { return(repo.GetList().Where(b => b.Content.CaseInsensitiveContains(str) || b.Title.CaseInsensitiveContains(str)).ToList()); }
public static List <Inventory> GetListByName(this IDataEntityRepository <Inventory> repo, string str) { return(repo.GetList().Where(i => i.ProductName.ToUpper().Equals(str.ToUpper())).ToList()); }
// GET: Blog public ActionResult Index() { List <BlogPost> b = _blog.GetList(); return(View(b)); }