// get project involve public List <ProjectInvolveViewModel> GetProjectInvolved(int userId) { List <ProjectInvolveViewModel> models = projectGateway.GetAssignedProjectIdByUserId(userId); List <ProjectInvolveViewModel> newModels = new List <ProjectInvolveViewModel>(); foreach (ProjectInvolveViewModel result in models) { result.NoOfMembers = projectGateway.TotalMembersById(result.ProjectId); result.ProjectShortName = GenerateSortName(result.ProjectName); result.NoOfTasks = taskGateway.GetTaskCountByProjectId(result.ProjectId); newModels.Add(result); } return(newModels); }