protected void CreateVersion(LambdaExpression factoryExpression)
            {
                Delegate factoryDelegate = factoryExpression.Compile();

                CompositeVersion version = new CompositeVersion(
                    Version,
                    new CompositeConstructor(parameters => factoryDelegate.DynamicInvoke(parameters)),
                    Properties
                    );

                State.Provider.TryAddVersion(Type, State.TypeName, version, State.VersionProperty);
            }
        internal bool TryAddVersion(Type type, string typeName, CompositeVersion version, CompositeProperty versionProperty)
        {
            CompositeType definition;

            if (TryGet(type, out definition))
            {
                List <CompositeVersion> versions = new List <CompositeVersion>(definition.Versions);
                versions.Add(version);
                AddOrReplace(type, typeName, new CompositeType(typeName, type, versions, definition.VersionProperty));
            }
            else
            {
                AddOrReplace(type, typeName, new CompositeType(typeName, type, new List <CompositeVersion>()
                {
                    version
                }, versionProperty));
            }

            return(true);
        }