public static IEnumerable <IMovementConfirmationStateDto> ToMovementConfirmationStateDtoCollection(IEnumerable <string> ids) { var states = new List <IMovementConfirmationStateDto>(); foreach (var id in ids) { var dto = new MovementConfirmationStateDtoWrapper(); dto.DocumentNumber = id; states.Add(dto); } return(states); }
public IMovementConfirmationStateDto Get(string id, string fields = null) { try { var idObj = id; var state = _movementConfirmationApplicationService.Get(idObj); if (state == null) { return(null); } var stateDto = new MovementConfirmationStateDtoWrapper(state); if (String.IsNullOrWhiteSpace(fields)) { stateDto.AllFieldsReturned = true; } else { stateDto.ReturnedFieldsString = fields; } return(stateDto); } catch (Exception ex) { var response = MovementConfirmationsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }