public static IEnumerable <IPicklistStateDto> ToPicklistStateDtoCollection(IEnumerable <string> ids) { var states = new List <IPicklistStateDto>(); foreach (var id in ids) { var dto = new PicklistStateDtoWrapper(); dto.PicklistId = id; states.Add(dto); } return(states); }
public IPicklistStateDto Get(string id, string fields = null) { try { var idObj = id; var state = _picklistApplicationService.Get(idObj); if (state == null) { return(null); } var stateDto = new PicklistStateDtoWrapper(state); if (String.IsNullOrWhiteSpace(fields)) { stateDto.AllFieldsReturned = true; } else { stateDto.ReturnedFieldsString = fields; } return(stateDto); } catch (Exception ex) { var response = PicklistsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }