public async Task <IActionResult> Gets([FromBody] ManufacturerMapping_GetManufacturerRequest request)
        {
            try
            {
                var response = await _manufacturerCategoryMappingAppService.Gets(request);

                return(Json(response));
            }
            catch (Exception e)
            {
                _logger.LogError(e, Common.Common.GetMethodName());
                throw;
            }
        }
コード例 #2
0
        public async Task <ManufacturerMapping_GetManufacturerResponse> Gets(ManufacturerMapping_GetManufacturerRequest request)
        {
            ManufacturerMapping_GetManufacturerResponse response = new ManufacturerMapping_GetManufacturerResponse();

            try
            {
                var manufacturers = await _manufacturerCategoryMappingService.Gets(request.CategoryId);

                if (manufacturers == null)
                {
                    response.SetFail(BaseResponse.ErrorCodeEnum.UserNotFound);
                    return(response);
                }
                response.Manufacturers = manufacturers?.Select(p => p.ToModel()).ToArray();
            }
            catch (Exception e)
            {
                response.SetFail(e);
                _logger.LogError(e, e.Message, request);
            }
            return(response);
        }