ViewComponentBuilderBase¶
Fluent builder base wrapping a ViewComponentBase-derived component, forwarding Render()/ToHtmlString() calls to the wrapped component so callers can configure and render in one fluent chain.
Purpose¶
- Fluent builder base wrapping a
ViewComponentBase-derived component, forwardingRender()/ToHtmlString()calls to the wrapped component so callers can configure and render in one fluent chain.
Context¶
- Namespace:
SAIF.Web.Mvc.UI - Assembly/package:
SAIF.Framework.Web.Mvc (source-shipping NuGet package) - Kind: abstract class (generic, TViewComponent, TBuilder)
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| ViewComponentBuilderBase(TViewComponent) | public ViewComponentBuilderBase(TViewComponent component) |
Stores the wrapped component in the protected-internal Component property for use by derived builders. |
| HtmlAttributes(object) | public virtual TBuilder HtmlAttributes(object attributes) |
Converts the anonymous object to a dictionary and delegates to the IDictionary<string, object> overload. |
| HtmlAttributes(IDictionary<string, object>) | public virtual TBuilder HtmlAttributes(IDictionary<string, object> attributes) |
Clears the wrapped component's HtmlAttributes and merges in the supplied dictionary, then returns the typed builder. |
| Name(string) | public virtual TBuilder Name(string componentName) |
Sets the wrapped component's Name, then returns the typed builder to continue the fluent chain. |
| Render() | public virtual void Render() |
Delegates to the wrapped component's Render(). |
| ToHtmlString() | public string ToHtmlString() |
Delegates to the wrapped component's ToHtmlString(). |
| ToString() | public override string ToString() |
Returns ToHtmlString(), so rendering the builder directly (e.g. in a Razor view) emits the component's markup. |
Sources¶
src/Web.Mvc/UI/ViewComponentBuilderBase.cs