I'm trying to write some custom extension methods and have been successful with ones like this:
public static ComponentBuilder<MvcBootstrapConfig<TModel>, Element> TaskDialogBody<TComponent, TModel>(
this BootstrapHelper<MvcBootstrapConfig<TModel>, TComponent> helper, string title)
where TComponent : Component, ICanCreate<Tag>
{
return helper.Div(helper.Heading2(title).ToString()).AddCss("dialog-header");
}
But I can't get my head around how to create nested elements without that ToString() call. For example, I need an extension method a div within a div and allow the caller to provide the content to be inserted in the inner div. How do I achieve this without converting the interior div to a string first? Any examples someone can point me to?