public IEnumerable <EndpointPart> GetAssociatedEndpoints(ErrorResultPart error) { return(_contentManager .Query <EndpointPart, EndpointPartRecord>(VersionOptions.Latest) .Where(record => record.SelectedErrorIds.Contains(error.Id.SerializeId())) .List()); }
public ErrorResult ToViewModel(ErrorResultPart part) { var tokenState = new Dictionary <string, object> { { "Content", part.ContentItem } }; var viewModel = new ErrorResult() { Code = part.Code.Value, Description = _tokenizer.Replace(part.As <BodyPart>().Text, tokenState), ReasonPhrase = _tokenizer.Replace(part.ReasonPhrase, tokenState), AssociatedEndpoints = GetAssociatedEndpoints(part).Select(ToViewModel) }; return(viewModel); }