Example #1
0
 public HttpResponseMessage Adicionar(CursoRequest request)
 {
     try
     {
         var response = _servico.Adicionar(request);
         return(Response(response, _servico));
     }
     catch (Exception ex)
     {
         return(ResponseException(ex));
     }
 }
Example #2
0
 public JsonResult Post(CursoRequest request)
 {
     try
     {
         var retorno = _servicoCurso.Adicionar(request);
         return(Json(retorno, JsonRequestBehavior.AllowGet));
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         throw;
     }
 }