Esempio n. 1
0
        // GET: api/Banner
        public IQueryable <AdminVideoVM> Get()
        {
            try
            {
                var adminProjectVM = new List <AdminVideoVM>();

                var videoModels = _projectImageService.GetMany(pi => pi.Type == 2 && pi.Deleted == false).AsQueryable();
                foreach (var bm in videoModels)
                {
                    var model = new AdminVideoVM()
                    {
                        ProjectImages = bm,
                        EditedUser    = _userFactory.GetUserNameById(bm.ModifiedById)
                    };
                    adminProjectVM.Add(model);
                }

                return(adminProjectVM.AsQueryable());
            }
            catch (Exception)
            {
                throw new Exception("Lỗi! Không thể tải dữ liệu!");
            }
        }
Esempio n. 2
0
        // GET: api/Banner
        public IQueryable<AdminVideoVM> Get()
        {
            try
            {
                var adminProjectVM = new List<AdminVideoVM>();

                var videoModels = _projectImageService.GetMany(pi => pi.Type == 2 && pi.Deleted == false).AsQueryable();
                foreach (var bm in videoModels)
                {
                    var model = new AdminVideoVM()
                    {
                        ProjectImages = bm,
                        EditedUser = _userFactory.GetUserNameById(bm.ModifiedById)
                    };
                    adminProjectVM.Add(model);
                }

                return adminProjectVM.AsQueryable();
            }
            catch (Exception)
            {
                throw new Exception("Lỗi! Không thể tải dữ liệu!");
            }
        }