Пример #1
0
        // 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));
        }
Пример #2
0
 public static List <Inventory> GetListByCategory(this IDataEntityRepository <Inventory> repo, Category category)
 {
     return(repo.GetList().Where(i => i.CategoryID.Equals(category.ID)).ToList());
 }
Пример #3
0
 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());
 }
Пример #4
0
 public static List <Inventory> GetListByName(this IDataEntityRepository <Inventory> repo, string str)
 {
     return(repo.GetList().Where(i => i.ProductName.ToUpper().Equals(str.ToUpper())).ToList());
 }
Пример #5
0
        // GET: Blog
        public ActionResult Index()
        {
            List <BlogPost> b = _blog.GetList();

            return(View(b));
        }