public GetProductTypes_Response GetAllProductType() { var data = _IProductTypeRepository.GetAll(); var retData = Mapper.Map <ResponseBase <List <Product_Type> >, GetProductTypes_Response>(data); return(retData); }
[HttpGet("listar")] // metodo GET para listar elementos public IActionResult GetAll() { var productTypes = _productTypeRepository.GetAll(); // Listamos elementos var productTypeDtos = _mapper.Map <IList <ProductTypeDto> >(productTypes); // Mapear entitidad a dto return(Ok(productTypeDtos)); }
private async Task <IQueryable <ProductType> > GetProductTypes() { var currentUserId = await _customerIdService.GetCustomerId(); var productTypes = _productTypeRepository.GetAll().Where(x => x.CustomerId == currentUserId); return(productTypes); }
private async Task <IQueryable <ProductType> > GetAllProductTypes() { var currentCustomerId = await _customerIdService.GetCustomerId(); var allProductTypes = _productTypeRepository.GetAll().Where(x => x.CustomerId == currentCustomerId && x.PriceCalculationType == PriceCalculationType.WithHeightAmount); return(allProductTypes); }
public JsonResult GetProductTypeCombo() { var Types = _productTypeRepository.GetAll(); return(Json(Types.Select(c => new ProductTypeViewModel { Id = c.Id, Title = c.Title }), JsonRequestBehavior.AllowGet)); }
private async Task <IEnumerable <ProdctTypeViewModel> > GetProductTypeViewModels() { var currentCustomerId = await _customerIdService.GetCustomerId(); return(_productTypeRepository.GetAll().Where(c => c.CustomerId == currentCustomerId) .Select(x => new ProdctTypeViewModel { Description = x.Description, Id = x.Id, Name = x.Name })); }
public IActionResult Index() { var productTypes = _context.GetAll(); if (productTypes.Count() == 0) { return(View(nameof(Empty))); } return(View(productTypes)); }
public async Task <ActionResult <List <ProductType> > > GetAllProductTypes() { var productType = await _repo.GetAll(); if (productType == null) { return(NotFound()); } return(Ok(productType)); }
public ActionResult ProductTypeList(DataSourceRequest command) { var productTypes = _productTypeRepository.GetAll(); var productTypeList = productTypes as IList <ProductType> ?? productTypes.ToList(); var productTypeModel = new PagedList <ProductType>(productTypeList.ToList(), command.Page, command.PageSize); var productTypeViewModel = productTypeModel.Select(item => new ProductTypeViewModel() { Id = item.Id, Title = item.Title, Show = item.Show }).ToList(); var dataSourceResult = new DataSourceResult() { Data = productTypeViewModel, Total = productTypeModel.TotalItemCount }; return(Json(dataSourceResult)); }
public List <ProductType> GetTypes() { return(ExecuteFaultHandledOperation(() => { List <ProductType> product_types = _cache.Get(CacheKeys.ProductTypes) as List <ProductType>; if (product_types == null) { Log.Debug("ProductTypeRepository GetAll called"); product_types = new List <ProductType>(); var product_type_data = _report_prod_type.GetAll(); foreach (ProductTypeData account_type in product_type_data) { product_types.Add(_prod_es.Map(account_type)); } _cache.Set(CacheKeys.ProductTypes, product_types); Log.Debug("ProductTypeRepository GetAll complete"); } return product_types; })); }
public async Task <ActionResult <IEnumerable <ProductTypeDto> > > GetProductTypes() { var productTypes = await _productTypeRepository.GetAll(); return(Ok(productTypes)); }
public IEnumerable <ProductTypeDTO> GetAllProductType() { IEnumerable <ProductType> list = productTypeRepository.GetAll(); return(list.MappingProductTypeDtos()); }
public List <ProductType> GetAll() { return(_productTypeRepositoryDAC.GetAll()); }
public List<ProductTypeViewModel> GetAll() { var result = productTypeRepository.GetAll(); return mapper.Map(result, new List<ProductTypeViewModel>()); }
public IEnumerable <ProductType> GetAll() { return(_repository.GetAll()); }
// GET: ProductTypes public async Task <ActionResult> Index() { var currentCustomerId = await _customerIdService.GetCustomerId(); return(View(await _productTypeRepository.GetAll().Where(x => x.CustomerId == currentCustomerId).ToListAsync())); }
public IActionResult GetProductTypes() { return(new JsonResult(_productTypeRepository.GetAll())); }