public ActionResult GetAllProductoByCategoriaId(int categoriaid) { dynamic resposonse = new ExpandoObject(); try { var item = _productoService.GetAllByCategoriaId(categoriaid); if (item != null) { resposonse.data = item; resposonse.errormensaje = ""; resposonse.error = false; } else { resposonse.data = null; resposonse.errormensaje = "No Existe Registros"; resposonse.error = true; } } catch (Exception ex) { resposonse.data = null; resposonse.errormensaje = ex.Message; resposonse.error = true; } object datos = (object)resposonse; return(Ok(datos)); }