Example #1
0
        internal ItemStorageConfig CreateStorageConfig(Type baseType, string actualTableName)
        {
            if (baseType == null)
            {
                throw new ArgumentNullException("baseType");
            }
            ITypeInfo         typeInfo = TypeFactory.GetTypeInfo(baseType);
            ItemStorageConfig config   = new ItemStorageConfig(typeInfo);

            PopulateConfigFromType(config, typeInfo);
            PopulateConfigFromMappings(config, AWSConfigs.DynamoDBConfig.Context.TypeMappings);

            // populate config from table definition only if actual table name is known
            if (!string.IsNullOrEmpty(actualTableName))
            {
                Table table = Context.GetTable(actualTableName);
                PopulateConfigFromTable(config, table);

                config.Denormalize();
            }

            return(config);
        }