public List <ViewInterestedClass> GetListClassId(int ClassId) { List <InterestedClass> list = _repository.GetListClassId(ClassId); List <ViewInterestedClass> model = new List <ViewInterestedClass>(); foreach (var item in list) { model.Add(ViewInterestedClass.ToViewModel(item)); } return(model); }