コード例 #1
0
        public async Task <IActionResult> GetAllByLocatableId(int locatableId)
        {
            var promos = await _promoService.ListByLocatableId(locatableId);

            if (promos == null)
            {
                return(BadRequest(ModelState.GetErrorMessages()));
            }
            var resources = _mapper.Map <IEnumerable <Promo>, IEnumerable <PromoResource> >(promos);

            return(Ok(resources));
        }