public UsersList() { var list = _context.SubmittedeStatusForUsers.ToList(); foreach (var user in _context.UserPurchases) { SubmittedStatusForUser completeStatus = (from x in list.OfType <SubmittedStatusForUser>() where x.UserId == user.Id select x).FirstOrDefault(); var userEntry = new UserEntry { User = user, WasCompleteQuestionnaire = (completeStatus != null) }; _users.Add(userEntry); } _users = _users.OrderBy(x => x.User.Name).ToList(); }
public UsersList() { var list = _context.SubmittedeStatusForUsers.ToList(); foreach (var user in _context.UserPurchases) { SubmittedStatusForUser completeStatus = (from x in list.OfType<SubmittedStatusForUser>() where x.UserId == user.Id select x).FirstOrDefault(); var userEntry = new UserEntry { User = user, WasCompleteQuestionnaire = (completeStatus != null) }; _users.Add(userEntry); } _users = _users.OrderBy(x => x.User.Name).ToList(); }