public static IDictionary<string, object> WriteExportDefinition(ComposablePartDefinition owner, ExportDefinition exportDefinition)
        {
            Assumes.NotNull(owner);
            Assumes.NotNull(exportDefinition);

            LazyMemberInfo exportingMemberInfo = ReflectionModelServices.GetExportingMember(exportDefinition);

            IDictionary<string, object> cache = new Dictionary<string, object>();
            cache.WriteContractName(exportDefinition.ContractName);
            cache.WriteMetadata(exportDefinition.Metadata);
            cache.WriteValue(AttributedCacheServices.CacheKeys.MemberType, exportingMemberInfo.MemberType, MemberTypes.TypeInfo);
            cache.WriteLazyAccessors(exportingMemberInfo.GetAccessors(), ReflectionModelServices.GetPartType(owner));

            return cache;
        }
        public static IDictionary<string, object> WritePartDefinition(ComposablePartDefinition part, bool writeAssembly)
        {
            Assumes.NotNull(part);

            IDictionary<string, object> cache = new Dictionary<string, object>();
            Lazy<Type> partType = ReflectionModelServices.GetPartType(part);

            cache.WriteMetadata(part.Metadata);
            cache.WriteLazyTypeForPart(partType, writeAssembly);
            cache.WriteValue<bool>(AttributedCacheServices.CacheKeys.IsDisposalRequired, ReflectionModelServices.IsDisposalRequired(part), false);

            return cache;
        }