public IActionResult Image(long id, string image) { try { Note userToUpdate = _notesBL.Get(id); if (userToUpdate == null) { return(NotFound("The User record couldn't be found.")); } bool result = _notesBL.Image(userToUpdate, image); if (result == true) { return(this.Ok(new { success = true, message = "Successfully Added Image" })); } else { return(this.BadRequest(new { success = false, message = "Image Adding Failed" })); } } catch (Exception ex) { return(this.Ok(new { success = false, message = ex.Message })); } }