예제 #1
0
        public IQueryable <LoaiSP> GetLoaiSPs()
        {
            var _db = new AnVat_WebTM.Models.SPcontext();
            IQueryable <LoaiSP> query = _db.LoaiSP;

            return(query);
        }
예제 #2
0
        public IQueryable <LoaiSP> GetBooks([QueryString("id")] int?Maloai)
        {
            var _db = new AnVat_WebTM.Models.SPcontext();
            IQueryable <LoaiSP> query = _db.LoaiSP;

            if (Maloai.HasValue && Maloai > 0)
            {
                query = query.Where(p => p.MaLoai == Maloai);
            }
            return(query);
        }