Beispiel #1
0
        public IEnumerable <ValveResponseModel> GetList()
        {
            IEnumerable <Valve> valveItems            = _valveService.GetList();
            IEnumerable <ValveResponseModel> itemList = valveItems?.Select(x => ModelBinder.Instance.ConvertToValveResponseModel(x));

            return(itemList);
        }
Beispiel #2
0
        public IEnumerable <GroupResponseModel> GetList()
        {
            IEnumerable <Group>             groupItems = groupService.GetList();
            IEnumerable <ValveGroupMapping> totalGroupValveMappingList = valveGroupMappingService.GetList();
            IEnumerable <Valve>             totalValveList             = valveService.GetList();

            List <GroupResponseModel> resultList = new List <GroupResponseModel>();

            foreach (Group group in groupItems)
            {
                List <long>         valveIds         = totalGroupValveMappingList.Where(x => x.GroupId == group.Id).Select(x => x.ValveId).ToList();
                IEnumerable <Valve> valve            = totalValveList.Where(x => valveIds.Contains(x.Id));
                GroupResponseModel  tempResponseItem = ModelBinder.Instance.ConvertToGroupResponseModel(group, valve);

                resultList.Add(tempResponseItem);
            }

            return(resultList);
        }