Exemplo n.º 1
0
        /// <summary>
        /// Gets or creates the configuration of a type.
        /// <para>It also creates the configuration of all base types.</para>
        /// </summary>
        /// <param name="type">The type to get the configuration.</param>
        /// <returns>The configuration.</returns>
        public TableConfig GetConfigOrDefault(Type type)
        {
            ConfigTypes.TryGetValue(type.FullName, out TableConfig config);

            if (config == null)
            {
                config = new TableConfig(type);

                // Add parent configuration
                if (type.BaseType != typeof(object))
                {
                    GetConfigOrDefault(type.BaseType);
                }

                configTypes.Add(type.FullName, config);
            }

            return(config);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EntityBuilder"/> class.
 /// </summary>
 /// <param name="config">The configuration data.</param>
 public EntityBuilder(TableConfig config)
 {
     Config = config;
 }