public static IEnumerable <IInventoryItemEntryMvoStateDto> ToInventoryItemEntryMvoStateDtoCollection(IEnumerable <InventoryItemEntryId> ids) { var states = new List <IInventoryItemEntryMvoStateDto>(); foreach (var id in ids) { var dto = new InventoryItemEntryMvoStateDtoWrapper(); dto.InventoryItemEntryId = id; states.Add(dto); } return(states); }
public IInventoryItemEntryMvoStateDto Get(string id, string fields = null) { try { var idObj = InventoryItemEntryMvosControllerUtils.ParseIdString(id); var state = _inventoryItemEntryMvoApplicationService.Get(idObj); if (state == null) { return(null); } var stateDto = new InventoryItemEntryMvoStateDtoWrapper(state); if (String.IsNullOrWhiteSpace(fields)) { stateDto.AllFieldsReturned = true; } else { stateDto.ReturnedFieldsString = fields; } return(stateDto); } catch (Exception ex) { var response = InventoryItemEntryMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }