Commit Graph

9 Commits

Author SHA1 Message Date
agrath
c7e1350abd Added .Name [string.Empty] and .Id [0] to DynamicNull and added implicit casts to int and string - backwards compat support for next commit 2011-10-09 06:36:56 -13:00
agrath@gmail.com
80e6187436 Made DynamicNull implictly convertable to DateTime (.MinValue) to support next change 2011-07-21 12:17:55 -12:00
agrath@gmail.com
48c11f6b45 Added TryInvoke and TryGetIndex methods to DynamicNull to prevent crashes on missing properties 2011-07-11 11:13:31 -12:00
agrath@gmail.com
cfcae904ba Added implicit conversion between DynamicNull and bool (false) which allows you to go @if(@Model.dynamicNullProperty) 2011-07-03 19:25:16 -12:00
agrath@gmail.com
93d65ced40 Add IsNull and HasValue methods to Dynamic* classes
**Breaking Change: DynamicNull.HasValue and DynamicNull.IsNull have been changed from properties to methods
Rename umbraco.MacroEngines.ExtensionMethods as umbraco.MacroEngines.PrivateExtensionMethods
Implement extension method invokes for DynamicNode
2011-03-22 18:02:32 -13:00
agrath@gmail.com
1716b94449 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
2011-03-09 07:52:05 -13:00
agrath@gmail.com
150d4648c1 Added support for chaining properties if a previous property access returns DynamicNull 2011-03-08 19:00:04 -13:00
agrath@gmail.com
aaa90bea14 More graceful handling of missing properties in .Where - TryGetMember now returns DynamicNull
Only return DynamicNull if property truely doesn't exist - if it does exist and has no value, still return null
2011-02-27 22:55:50 -13:00
agrath@gmail.com
60c18bdff9 More graceful handling of missing properties in .Where - TryGetMember now returns DynamicNull (IEnumerable with fake .Where and .OrderBy) when the property/child type doesn't exist.
Expression Tree in DynamicQueryable explictly checks for this type and forces that portion of the predicate/expression tree to return true, bypassing the missing property
Handy when you are checking e.g. a boolean property in a .Where and that boolean doesn't exist on all nodes.
2011-02-27 21:53:45 -13:00