コード例 #1
0
        public IActionResult ModelosLeerPorID(int IDFamilia)
        {
            ObjectResult result;
            var          ad = new AdaptadorAtc(_configuration);

            try
            {
                var res = ad.ModelosLeerPorID(IDFamilia);
                result = new ObjectResult(res)
                {
                    StatusCode = (int)HttpStatusCode.OK
                };
            }
            catch (Exception ex)
            {
                result = new ObjectResult(ex)
                {
                    StatusCode = (int)HttpStatusCode.Conflict
                };
                Request.HttpContext.Response.Headers.Add("dsError", ex.Message);
            }
            return(result);
        }