Ejemplo n.º 1
0
        public IActionResult GetById(int id)
        {
            try
            {
                if (id <= 0)
                {
                    throw new ArgumentException($"{nameof(id)} parametresi 0'dan büyük olmalı.");
                }

                return(Ok(_newService.GetNewById(id)));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }