public bool Validate <T>(Patch patch)
        {
            var typeInfo = _typeTreeCache.GetOrCreate <T>();
            PropertyAccessor propertyChain;

            if (!typeInfo.Accessors.TryGetValue(patch.Path, out propertyChain))
            {
                return(false);
            }

            return(ValidateDataType(propertyChain.PropertyChain.Last().PropertyType, patch.Value));
        }
Beispiel #2
0
 public ObjectBuilder(TypeTreeCache typeTreeCache, IDictionary <Type, IValueType> valueTypes)
 {
     if (typeTreeCache == null)
     {
         throw new ArgumentNullException("typeTreeCache");
     }
     if (valueTypes == null)
     {
         throw new ArgumentNullException("valueTypes");
     }
     _typeInfo      = typeTreeCache.GetOrCreate <T>();
     _typeTreeCache = typeTreeCache;
     _valueTypes    = valueTypes;
 }
Beispiel #3
0
 private object CreateInstance(Type type)
 {
     return(_typeTreeCache.GetOrCreate(type).CreateInstance());
 }