public static IEnumerable <IUomTypeStateDto> ToUomTypeStateDtoCollection(IEnumerable <string> ids) { var states = new List <IUomTypeStateDto>(); foreach (var id in ids) { var dto = new UomTypeStateDtoWrapper(); dto.UomTypeId = id; states.Add(dto); } return(states); }
public IUomTypeStateDto Get(string id, string fields = null) { try { var idObj = id; var state = _uomTypeApplicationService.Get(idObj); if (state == null) { return(null); } var stateDto = new UomTypeStateDtoWrapper(state); if (String.IsNullOrWhiteSpace(fields)) { stateDto.AllFieldsReturned = true; } else { stateDto.ReturnedFieldsString = fields; } return(stateDto); } catch (Exception ex) { var response = UomTypesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }