public IHttpActionResult DeleteAllMailsMoveToTrash(Int64 Rid) { string data = da.AllMailMoveToTrash(Rid); if (data == "success") { return(Ok(data)); } else { HttpError myCustomError = new HttpError("Not Move To Trash") { { "Type", "w" } }; return(Content(HttpStatusCode.BadRequest, myCustomError)); } }