Example #1
0
 public IHttpActionResult PostUnidadCultivoTemporadaCosteM3Agua([FromBody] Temporada temporada)
 {
     try {
         /*
          * ClaimsIdentity identity = Thread.CurrentPrincipal.Identity as ClaimsIdentity;
          * bool isAdmin = identity.Claims.SingleOrDefault(c => c.Type == ClaimTypes.Role).Value == "admin";
          * if (isAdmin == false)
          *  return Unauthorized();
          */
         CacheDatosHidricos.ClearAll();
         return(Json(DB.TemporadaSave(temporada)));
     } catch (Exception ex) {
         return(BadRequest(ex.Message));
     }
 }