var courses = _repository.GetAllCoursesDetailsByCourseId(id);
var result = (from s in courses select new { id = s.Course_ID, name=s.Course_Date}).Distinct().ToList();
Now what i want to do is to iterate through result and edit all of its "name" content . . a rough idea is below :
foreach (var i in result)
{
string[] temp = i.name.Split(',');
string[] token = temp[0].Split(' ');
string newtemp = token[1] + " " + temp[1];
i.name = newtemp;
}
But this is not working. How can i edit the content in var result?