I am wondering if there is a better way to do the following:
IList<RoleViewModel> ReturnViewModel = new List<RoleViewModel>(); IList<Role> AllRoles = PermServ.GetAllRoles(); foreach (var CurRole in AllRoles) { ReturnViewModel.Add(new RoleViewModel(CurRole)); }
Its fairly simple code just takes a data object and converts it to a ViewModel. I was wondering if there is a way to make this better? “Maybe with Link?”
LiamB source share