public static IEnumerable <IMovementConfirmationLineMvoStateDto> ToMovementConfirmationLineMvoStateDtoCollection(IEnumerable <MovementConfirmationLineId> ids) { var states = new List <IMovementConfirmationLineMvoStateDto>(); foreach (var id in ids) { var dto = new MovementConfirmationLineMvoStateDtoWrapper(); dto.MovementConfirmationLineId = id; states.Add(dto); } return(states); }
public IMovementConfirmationLineMvoStateDto Get(string id, string fields = null) { try { var idObj = MovementConfirmationLineMvosControllerUtils.ParseIdString(id); var state = _movementConfirmationLineMvoApplicationService.Get(idObj); if (state == null) { return(null); } var stateDto = new MovementConfirmationLineMvoStateDtoWrapper(state); if (String.IsNullOrWhiteSpace(fields)) { stateDto.AllFieldsReturned = true; } else { stateDto.ReturnedFieldsString = fields; } return(stateDto); } catch (Exception ex) { var response = MovementConfirmationLineMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }