コード例 #1
0
        public List <SizeViewModel> GetAll()
        {
            var sizes   = _sizeRepository.FindAll();
            var sizeVms = sizes.ProjectTo <SizeViewModel>(sizes).ToList();

            return(sizeVms);
        }
コード例 #2
0
        public List <SizeViewModel> GetSizeByProduct(int productId)
        {
            var query = (from t in _productQuantityRepository.FindAll()
                         join pt in _sizeRepository.FindAll()
                         on t.SizeId equals pt.Id
                         where t.ProductId == productId
                         select pt).Distinct();

            return(query.ProjectTo <SizeViewModel>().ToList());
        }
コード例 #3
0
        public PageResult <SizeModel> GetSearchPaging(RoleSearch search)
        {
            var query = _sizeRepository.FindAll();

            if (search.Id > 0)
            {
                query = query.Where(r => r.Id == search.Id);
            }

            if (!string.IsNullOrEmpty(search.Name))
            {
                query = query.Where(r => r.Name.Contains(search.Name));
            }
            //if (!string.IsNullOrEmpty(search.Description))
            //{
            //    query = query.Where(r => r.Description.Contains(search.Description));
            //}
            var Total = query.Count();

            var data = query
                       .OrderByDescending(U => U.CreatedDate)
                       .Skip((search.PageIndex - 1) * search.PageSize)
                       .Take(search.PageSize)
                       .Select(u => u.ToModel())
                       .ToList();

            var result = new PageResult <SizeModel>()
            {
                Results   = data,
                PageIndex = search.PageIndex,
                PageSize  = search.PageSize,
                Total     = Total,
            };

            return(result);
        }
コード例 #4
0
 public List <SizeViewModel> GetSizes()
 {
     return(_sizeRepository.FindAll().ProjectTo <SizeViewModel>().ToList());
 }
コード例 #5
0
        public List <SizeViewModel> GetAllSize()
        {
            var sizes = _sizeRepository.FindAll().ToList();

            return(Mapper.Map <List <Size>, List <SizeViewModel> >(sizes));
        }
コード例 #6
0
 public async Task <List <SizeViewModel> > GetSizes()
 {
     return(new SizeViewModel().Map((await _sizeRepository.FindAll()).AsNoTracking()).ToList());
 }
コード例 #7
0
 List <SizeViewModel> IBillService.GetSizes()
 {
     return(_sizeRepository.FindAll().ProjectTo <SizeViewModel>().ToList());
 }
コード例 #8
0
 public async Task <List <SizeViewModel> > GetAll()
 {
     return(new SizeViewModel().Map(await _sizeRepository.FindAll()).ToList());
 }
コード例 #9
0
 public List <SizeViewModel> GetSizes()
 {
     return(_sizeRepository.FindAll().ProjectTo <SizeViewModel>(_mapper.ConfigurationProvider).ToList());
 }