Class PartialViewMacroModelExtensions
Extension methods for the PartialViewMacroModel object
Inheritance
System.Object
Namespace: Umbraco.Web.Models
Assembly: Umbraco.Web.dll
Syntax
public static class PartialViewMacroModelExtensions
Methods
View SourceGetParameterValue<T>(PartialViewMacroModel, String)
Attempt to get a Macro parameter from a PartialViewMacroModel
Declaration
public static T GetParameterValue<T>(this PartialViewMacroModel partialViewMacroModel, string parameterAlias)
Parameters
Type | Name | Description |
---|---|---|
PartialViewMacroModel | partialViewMacroModel | |
System.String | parameterAlias |
Returns
Type | Description |
---|---|
T | Parameter value if available, the default value for the type otherwise. |
Type Parameters
Name | Description |
---|---|
T |
GetParameterValue<T>(PartialViewMacroModel, String, T)
Attempt to get a Macro parameter from a PartialViewMacroModel and return a default value otherwise
Declaration
public static T GetParameterValue<T>(this PartialViewMacroModel partialViewMacroModel, string parameterAlias, T defaultValue)
Parameters
Type | Name | Description |
---|---|---|
PartialViewMacroModel | partialViewMacroModel | |
System.String | parameterAlias | |
T | defaultValue |
Returns
Type | Description |
---|---|
T | Parameter value if available, the default value that was passed otherwise. |
Type Parameters
Name | Description |
---|---|
T |