예제 #1
0
        public async Task <IActionResult> GetBrandById([FromRoute] string name)
        {
            try
            {
                Brand brand = await _service.FindBrandByName(name);

                if (brand == null)
                {
                    return(NotFound());
                }
                return(Ok(brand));
            }
            catch (Exception e)
            {
                return(StatusCode(500, e));
            }
        }