Exemplo n.º 1
0
 public ActionResult <Set> Create([FromBody] Set newSet)
 {
     try
     {
         return(Ok(_ts.Create(newSet)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
Exemplo n.º 2
0
 public ActionResult <Set> Create([FromBody] Set newData)
 {
     try
     {
         return(Ok(_ss.Create(newData)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Exemplo n.º 3
0
 public ActionResult <Set> Post([FromBody] Set newSet)
 {
     try
     {
         var userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
         newSet.UserId = userId;
         return(Ok(_ss.Create(newSet)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }