public IResult <List <IItemDTO> > GetItems() { IResult <List <IItemDTO> > res = new Result <List <IItemDTO> >(); List <IItemDTO> items = new List <IItemDTO>(); try { ItemServiceClient client = this.serviceProxy as ItemServiceClient; ResponseOfTypeArrayOfItem resp = client.GetItems(); client.Close(); if (resp.IsSuccessful) { foreach (IItemDTO dto in resp.Result) { items.Add(dto); } res.IsSuccessful = true; res.Message = ""; res.Method = resp.Method; res.Result = items; } else { res.IsSuccessful = false; res.Message = resp.Message; res.Method = resp.Method; res.Result = items; } } catch (Exception ex) { res.IsSuccessful = false; res.Message = ex.Message; res.Method = "GetItems"; res.Result = items; } return(res); }