public async Task <ActionResult <Response> > UpdTag([FromBody] TagProducto tag) { object rpta = new object(); try { tag = (TagProducto)ValidateParameters(tag, tag.GetType()); rpta = await _productologic.UpdTag(tag); if (rpta == null) { return(NotFound()); } } catch (Exception e) { Response response = new Response(); response.Status = Constant.Error500; response.Message = e.Message; return(Ok(response)); } return(Ok(rpta)); }
public async Task <ActionResult <Response> > UpdTag([FromBody] TagProducto tag) { Response response = new Response(); object rpta = new object(); try { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } tag = (TagProducto)BusinessLogic.Utilities.AuxiliarMethods.ValidateParameters(tag, tag.GetType()); rpta = await _productologic.UpdTag(tag); if (rpta == null) { return(NotFound()); } } catch (Exception e) { response.Status = Constant.Error500; response.Message = e.Message; return(Ok(response)); } return(Ok(rpta)); }