Ejemplo n.º 1
0
            protected override object HandleDictionaryType(object currentObj, HandleModelAttributesContext context)
            {
                Func <object, object> handler = s => Handler.Handle(s, context);

                HandleGenericItemsHelper.HandleIDictionary(currentObj, s => Handler.Handle(s, context));
                return(currentObj);
            }
Ejemplo n.º 2
0
        /// <summary>
        /// By default enumerate Enumerable type if it does not have defined Attribute
        /// </summary>
        /// <param name="currentObj"></param>
        /// <param name="context"></param>
        protected virtual object HandleIEnumerableType(object currentObj, HandleModelAttributesContext context)
        {
            if (currentObj == null)
            {
                return(null);
            }
            Func <object, object> handler = s => Handler.Handle(s, context);

            HandleGenericItemsHelper.EnumerateIEnumerable(currentObj, s => Handler.Handle(s, context));
            return(currentObj);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// By default enumerate Dictionary's value if it does not have defined Attribute
        /// </summary>
        /// <param name="declaringObject"></param>
        /// <param name="currentPropertyInfo"></param>
        /// <param name="context"></param>
        protected virtual object HandleDictionaryType(object currentObj, HandleModelAttributesContext context)
        {
            if (currentObj == null)
            {
                return(null);
            }
            Func <object, object> handler = s => Handler.Handle(s, context);

            if (!HandleGenericItemsHelper.EnumerateIDictionary(currentObj, handler))
            {
                HandleGenericItemsHelper.EnumerateIReadonlyDictionary(currentObj, handler);
            }
            return(currentObj);
        }
Ejemplo n.º 4
0
 protected override object HandleIEnumerableType(object currentObj, HandleModelAttributesContext context)
 {
     HandleGenericItemsHelper.HandleIList(currentObj, s => Handler.Handle(s, context));
     return(currentObj);
 }