Skip to content

BuilderExtensions Methods

Ed Charbeneau edited this page Jan 16, 2020 · 2 revisions
public static class BuilderExtensions

Used to convert a CssBuilder into a null when it is empty. Usage: class=null causes the attribute to be excluded when rendered.

public static string NullIfEmpty(this CssBuilder builder)

Used to convert a StyleBuilder into a null when it is empty. Usage: style=null causes the attribute to be excluded when rendered.

public static string NullIfEmpty(this StyleBuilder builder)

Used to convert a string.IsNullOrEmpty into a null when it is empty. Usage: attribute=null causes the attribute to be excluded when rendered.

public static string NullIfEmpty(this string s)

Examples

See the following pages for examples with: