public static MvcHtmlString QueryTokenDNBuilder(this HtmlHelper helper, TypeContext<QueryTokenEntity> ctx, QueryTokenBuilderSettings settings) { if (ctx.Value.Try(qt => qt.ParseException) != null) { HtmlStringBuilder sb = new HtmlStringBuilder(); sb.Add(new HtmlTag("div").Class("ui-state-error").SetInnerText(ctx.Value.ParseException.Message).ToHtml()); sb.Add(new HtmlTag("pre").SetInnerText(ctx.Value.TokenString).ToHtml()); sb.Add(helper.QueryTokenBuilder(null, ctx, settings)); return sb.ToHtml(); } else { return helper.QueryTokenBuilder(ctx.Value.Try(ct => ct.Token), ctx, settings); } }
public static MvcHtmlString QueryTokenDNBuilder(this HtmlHelper helper, TypeContext <QueryTokenEmbedded> ctx, QueryTokenBuilderSettings settings) { if (ctx.Value?.ParseException != null) { HtmlStringBuilder sb = new HtmlStringBuilder(); sb.Add(new HtmlTag("div").Class("ui-state-error").SetInnerText(ctx.Value.ParseException.Message).ToHtml()); sb.Add(new HtmlTag("pre").SetInnerText(ctx.Value.TokenString).ToHtml()); sb.Add(helper.QueryTokenBuilder(null, ctx, settings)); return(sb.ToHtml()); } else { return(helper.QueryTokenBuilder(ctx.Value?.Token, ctx, settings)); } }