Example #1
0
        public IActionResult Get(int id)
        {
            try
            {
                MyModel myModel = _exampleRepository.GetSingle(id);

                if (myModel == null)
                {
                    return(NotFound());
                }

                return(Ok(Mapper.Map <MyModelViewModel>(myModel)));
            }
            catch (Exception exception)
            {
                //Do something with the exception
                return(StatusCode((int)HttpStatusCode.InternalServerError));
            }
        }