Ensure `TemplateInfo.FormattedModelValue` & `HtmlFieldPrefix` are not `null`
- Fixes #705
This commit is contained in:
parent
e7c2faff32
commit
88cd886a5b
|
|
@ -9,13 +9,16 @@ namespace Microsoft.AspNet.Mvc
|
||||||
{
|
{
|
||||||
public class TemplateInfo
|
public class TemplateInfo
|
||||||
{
|
{
|
||||||
|
private string _htmlFieldPrefix;
|
||||||
|
private object _formattedModelValue;
|
||||||
|
|
||||||
// Keep a collection of visited objects to prevent infinite recursion.
|
// Keep a collection of visited objects to prevent infinite recursion.
|
||||||
private HashSet<object> _visitedObjects;
|
private HashSet<object> _visitedObjects;
|
||||||
|
|
||||||
public TemplateInfo()
|
public TemplateInfo()
|
||||||
{
|
{
|
||||||
FormattedModelValue = string.Empty;
|
_htmlFieldPrefix = string.Empty;
|
||||||
HtmlFieldPrefix = string.Empty;
|
_formattedModelValue = string.Empty;
|
||||||
_visitedObjects = new HashSet<object>();
|
_visitedObjects = new HashSet<object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -26,9 +29,17 @@ namespace Microsoft.AspNet.Mvc
|
||||||
_visitedObjects = new HashSet<object>(original._visitedObjects);
|
_visitedObjects = new HashSet<object>(original._visitedObjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
public object FormattedModelValue { get; set; }
|
public object FormattedModelValue
|
||||||
|
{
|
||||||
|
get { return _formattedModelValue; }
|
||||||
|
set { _formattedModelValue = value ?? string.Empty; }
|
||||||
|
}
|
||||||
|
|
||||||
public string HtmlFieldPrefix { get; set; }
|
public string HtmlFieldPrefix
|
||||||
|
{
|
||||||
|
get { return _htmlFieldPrefix; }
|
||||||
|
set { _htmlFieldPrefix = value ?? string.Empty; }
|
||||||
|
}
|
||||||
|
|
||||||
public int TemplateDepth
|
public int TemplateDepth
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue