public static QuestionModel GetQuestionByMessageId(string messageId) { try { var question = SQLAdapter.GetQuestionByMessageId(messageId); //if (question.QuestionUser != null) //{ // var questionUser = SQLAdapter.GetUserById(question.QuestionUser.Id); // question.QuestionUser = questionUser; //} //if (question.AnswerUser != null) //{ // var answerUser = SQLAdapter.GetUserById(question.AnswerUser.Id); // question.AnswerUser = answerUser; //} return(ModelMapper.MapToQuestionModel(question)); } catch (Exception e) { return(null); } }