public DashboardModel GetUsers() { var model = new DashboardModel() { Labels = new List <string>(), Datas = new List <int>() }; var list = userInfoService.GetAll(); var types = EnumCollection.GetUserTypeEnum(); foreach (var s in types) { model.Labels.Add(s.Name); model.Datas.Add(list.Count(l => l.UserTypeID == s.ID)); } return(model); }