public static IEnumerable <ILotStateDto> ToLotStateDtoCollection(IEnumerable <string> ids) { var states = new List <ILotStateDto>(); foreach (var id in ids) { var dto = new LotStateDtoWrapper(); dto.LotId = id; states.Add(dto); } return(states); }
public ILotStateDto Get(string id, string fields = null) { try { var idObj = id; var state = _lotApplicationService.Get(idObj); if (state == null) { return(null); } var stateDto = new LotStateDtoWrapper(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); } }