public HttpResponseMessage Get(string roomid, string messageText, string token) { string id = Guid.NewGuid().ToString(); string insert = "INSERT INTO messages (id, messagetext, roomid) VALUES('" + id + "','" + messageText + "','" + roomid + "'); "; dataAcces.ExecuteQuery(insert); getRoomsController getRoomsController = new getRoomsController(); return(getRoomsController.Get(roomid, token)); }
public HttpResponseMessage Get(string roomid, string messageID, string token) { string insert = "delete from messages where id='" + messageID + "'"; int rowsAffected = dataAcces.ExecuteQuery(insert); if (rowsAffected == 0) { //todo no rows found, what to return throw new Exception("message does not exist"); } getRoomsController getRoomsController = new getRoomsController(); return(getRoomsController.Get(roomid, token)); }