c# - Show XML node value in MVC view by number of similar node? -
is there anyway group xml node value similar number? had tried output value below can't out want. please guide me on this. thanks! my answer_data sample in database: (after extract c1 , c2) question_id | answer_data ============================================== 1 | <answer_data><answer>c1</answer> 2 | <answer_data><answer>c2</answer> 3 | <answer_data><answer>c2</answer> string[] data after extract using linq: ["c1","c2","c2"] able view in mvc: c1 c2 c2 what want is: c1 - 1 c2 - 2 my controller: public actionresult surv_answer_result(int survey_id, string language = "eng") { list<answerquestionviewmodel> viewmodel = new list<answerquestionviewmodel>(); var query = r in db.surv_question_ext_model join s in db.surv_question_model ...