public static IEnumerable <IUomStateDto> ToUomStateDtoCollection(IEnumerable <string> ids) { var states = new List <IUomStateDto>(); foreach (var id in ids) { var dto = new UomStateDtoWrapper(); dto.UomId = id; states.Add(dto); } return(states); }
public IUomStateDto Get(string id, string fields = null) { try { var idObj = id; var state = _uomApplicationService.Get(idObj); if (state == null) { return(null); } var stateDto = new UomStateDtoWrapper(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); } }