public GroupResponseModel Get(long id) { Group group = groupService.Get(id); IEnumerable <Valve> valves = new List <Valve>(); if (group != null) { List <long> valveIds = valveGroupMappingService.GetListByGroup(group.Id).Select(x => x.ValveId).ToList(); valves = valveIds.Count() != 0 ? valveService.GetListByIds(valveIds) : valves; } GroupResponseModel responseModel = ModelBinder.Instance.ConvertToGroupResponseModel(group, valves); return(responseModel); }
private IEnumerable<Valve> GetContainedValveItems(IEnumerable<long> ids) { IEnumerable<Valve> valves; if (ids != null && ids.Count() > 0) { valves = _valveService.GetListByIds(ids.ToList()); } else { valves = new List<Valve>(); } return valves; }