public async Task <IActionResult> AddPost([FromBody] UserProfile model) { if (ModelState.IsValid) { try { var postId = await facade.AddPost(model); if (postId > 0) { return(Ok(postId)); } else { return(NotFound()); } } catch (Exception) { return(BadRequest()); } } return(BadRequest()); }