Create() public method

public Create ( bool initEarly ) : object
initEarly bool
return object
Exemplo n.º 1
0
        /// <exception cref="System.MemberAccessException" />
        /// <exception cref="System.Reflection.TargetInvocationException" />
        public static object CreateBean(BeanConfig config)
        {
            var bean = config.Create(true);

            if (bean is IDictionary <string, object> )
            {
                var map = (IDictionary <string, object>)bean;
                foreach (var entry in config.Params)
                {
                    var key   = entry.Key;
                    var value = entry.Value;
                    if (value is BeanConfig)
                    {
                        var mapBeanConfig = (BeanConfig)entry.Value;
                        value = mapBeanConfig.Create(true);
                        Mapping(value, mapBeanConfig.Params);
                    }
                    map[key] = value;
                }
            }
            else if (bean is IList <object> )
            {
                //
            }
            else
            {
                Mapping(bean, config.Params);
            }
            return(bean);
        }
Exemplo n.º 2
0
 /// <exception cref="System.MemberAccessException" />
 /// <exception cref="System.Reflection.TargetInvocationException" />
     public static object CreateBean(BeanConfig config)
     {
         var bean = config.Create(true);
         if (bean is IDictionary<string, object>)
         {
             var map = (IDictionary<string, object>) bean;
             foreach (var entry in config.Params)
             {
                 var key = entry.Key;
                 var value = entry.Value;
                 if (value is BeanConfig)
                 {
                     var mapBeanConfig = (BeanConfig) entry.Value;
                     value = mapBeanConfig.Create(true);
                     Mapping(value, mapBeanConfig.Params);
                 }
                 map[key] = value;
             }
         }
         else if (bean is IList<object>)
         {
             //
         }
         else
         {
             Mapping(bean, config.Params);
         }
         return bean;
     }