Esempio n. 1
0
 public ActionResult <Prova> Get([FromServices] ProvaDao dao, Guid id)
 {
     try
     {
         return(dao.find(id));
     }
     catch (Exception e)
     {
         return(new StatusCodeResult(400));
     }
 }
Esempio n. 2
0
 public ActionResult <IEnumerable <Prova> > Get([FromServices] ProvaDao dao)
 {
     try
     {
         return(dao.findAll().ToList());
     }
     catch (Exception e)
     {
         return(new StatusCodeResult(400));
     }
 }
Esempio n. 3
0
 public ActionResult <IEnumerable <Prova> > GetByInstituicao([FromServices] ProvaDao dao,
                                                             Guid id)
 {
     try
     {
         return(dao.findByInstituicao(id));
     }
     catch (Exception e)
     {
         return(new StatusCodeResult(400));
     }
 }
Esempio n. 4
0
 public ActionResult <Prova> Post([FromServices] ProvaDao dao,
                                  [FromServices] InstituicaoDao insDao,
                                  [FromBody] Prova value)
 {
     try
     {
         return(dao.add(value));
     }
     catch (Exception e)
     {
         return(new StatusCodeResult(400));
     }
 }