Пример #1
0
        public JsonResult Get(int id)
        {
            Curso curso = new Curso
            {
                Id = id
            };
            CursoModel cursoQuery = new CursoModel(curso);


            if (cursoQuery.ReadById())
            {
                ResponseMenssage response = new ResponseMenssage("success", cursoQuery.Curso);
                return(new JsonResult(response));
            }
            else
            {
                ResponseMenssage response = new ResponseMenssage("error", "curso no encontrada");
                return(new JsonResult(response));
            }
        }