Added some extra properties/functions to DynamicNull to provide a way to check to see if a child doc type actually exists.

.HasProperty will check for a property existence but because the child types are returned as DynamicNull, you couldn't check for null equality.
Use DynamicNull's .IsNull (true) or .HasValue (false) or .Count() (0) or a typeof check
This commit is contained in:
agrath@gmail.com
2011-03-09 07:52:05 -13:00
parent f5a7001859
commit 1716b94449

View File

@@ -26,6 +26,10 @@ namespace umbraco.MacroEngines
{
return this;
}
public int Count()
{
return 0;
}
public override string ToString()
{
return string.Empty;
@@ -35,5 +39,19 @@ namespace umbraco.MacroEngines
result = this;
return true;
}
public bool IsNull
{
get
{
return true;
}
}
public bool HasValue
{
get
{
return false;
}
}
}
}