public List<Group> GetGroups(int accountId) { var query = GetAllGroups(); if (accountId > 0) { var account = new AccountDao().GetAccount(accountId); if (string.IsNullOrEmpty(account.Groups)) { return new List<Group>(); } var groupIds = account.Groups.Split(',').Select(s => int.Parse(s)); return query.Where(e => groupIds.Contains(e.GroupId)).ToList(); } else { return query; } }
public List <Group> GetGroups(int accountId) { var query = GetAllGroups(); if (accountId > 0) { var account = new AccountDao().GetAccount(accountId); if (string.IsNullOrEmpty(account.Groups)) { return(new List <Group>()); } var groupIds = account.Groups.Split(',').Select(s => int.Parse(s)); return(query.Where(e => groupIds.Contains(e.GroupId)).ToList()); } else { return(query); } }