예제 #1
0
        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);
        }
예제 #2
0
        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;
        }