Beispiel #1
0
        public IActionResult GetAllProductGroups(ProductGroupResourceParameters resourceParameters)
        {
            if (!_typeHelperService.TypeHasProperties <ProductGroupDto>(resourceParameters.Fields))
            {
                return(BadRequest());
            }

            var entities = _productGroupRepository.GetAll();

            var productGroups = Mapper.Map <IEnumerable <ProductGroupDto> >(entities).ShapeData(resourceParameters.Fields);

            return(Ok(productGroups));
        }
Beispiel #2
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public IEnumerable <ProductGroup> GetProductGroups()
 {
     return(_roleRepository.GetAll());
 }