Skip to content
Loading
}
@*@Html.DisplayFor(modelItem => item.course.Course_Name)*@
but check it's out put is wrong i am not sure why , it is showing five courses for ALAM but in db there are 4 rows for this user,secondly the grouping is still repeating the number of rows which is wrong
https://imgur.com/33BJUjA
0
  • Ashutosh Gupta
    0
    Mark,
     
    your approach is right on view side, when you say groupby few records will be duplicated as your are trying to group it by name.. 
    my suggestion is to not to use groupby here, just create two list(Teachers and courses) here which you want to display .
    as i mentioned you can create one view model with these two list and make that as model for view.
    public class DummyViewamodel
    {
       IEnumerable Courses ;
       IEnumerable Courses ; 
    } 
     
    fill this view model on your controller and return view(dummyviewmodel instance).  
     
    @*@model DummyViewamodel
    0