public static IEnumerable <IPartyRoleStateDto> ToPartyRoleStateDtoCollection(IEnumerable <PartyRoleId> ids) { var states = new List <IPartyRoleStateDto>(); foreach (var id in ids) { var dto = new PartyRoleStateDtoWrapper(); dto.PartyRoleId = id; states.Add(dto); } return(states); }
public IPartyRoleStateDto Get(string id, string fields = null) { try { var idObj = PartyRolesControllerUtils.ParseIdString(id); var state = _partyRoleApplicationService.Get(idObj); if (state == null) { return(null); } var stateDto = new PartyRoleStateDtoWrapper(state); if (String.IsNullOrWhiteSpace(fields)) { stateDto.AllFieldsReturned = true; } else { stateDto.ReturnedFieldsString = fields; } return(stateDto); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }