public IHttpActionResult Password([FromBody] object json) { JObject o = JObject.Parse(JsonConvert.SerializeObject(json)); string correo = (string)o["correo"]; string old_pass = (string)o["old_pass"]; string new_pass = (string)o["new_pass"]; using (var context = new csmEntities()) { var temp = context.Database.SqlQuery <bool>("call cambiar_password (@correo, @old_pass, @new_pass)", new MySqlParameter("@correo", correo), new MySqlParameter("@old_pass", old_pass), new MySqlParameter("@new_pass", old_pass)).ToList(); context.SaveChanges(); return(Ok(temp)); } }
public IHttpActionResult Enviar([FromBody] object json) { JObject o = JObject.Parse(JsonConvert.SerializeObject(json)); string id_emisor = (string)o["id_emisor"]; string id_receptor = (string)o["id_receptor"]; string mensaje = (string)o["mensaje"]; using (var context = new csmEntities()) { var temp = context.Database.SqlQuery <bool>("call crear_mensaje (@id_emisor, @id_receptor, @mensaje)", new MySqlParameter("@id_emisor", id_emisor), new MySqlParameter("@id_receptor", id_receptor), new MySqlParameter("@mensaje", mensaje)).ToList(); context.SaveChanges(); return(Ok(temp)); } }