public List <SizeViewModel> GetAll() { var sizes = _sizeRepository.FindAll(); var sizeVms = sizes.ProjectTo <SizeViewModel>(sizes).ToList(); return(sizeVms); }
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()); }
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); }
public List <SizeViewModel> GetSizes() { return(_sizeRepository.FindAll().ProjectTo <SizeViewModel>().ToList()); }
public List <SizeViewModel> GetAllSize() { var sizes = _sizeRepository.FindAll().ToList(); return(Mapper.Map <List <Size>, List <SizeViewModel> >(sizes)); }
public async Task <List <SizeViewModel> > GetSizes() { return(new SizeViewModel().Map((await _sizeRepository.FindAll()).AsNoTracking()).ToList()); }
List <SizeViewModel> IBillService.GetSizes() { return(_sizeRepository.FindAll().ProjectTo <SizeViewModel>().ToList()); }
public async Task <List <SizeViewModel> > GetAll() { return(new SizeViewModel().Map(await _sizeRepository.FindAll()).ToList()); }
public List <SizeViewModel> GetSizes() { return(_sizeRepository.FindAll().ProjectTo <SizeViewModel>(_mapper.ConfigurationProvider).ToList()); }