Ejemplo n.º 1
0
        private static Type GetAssociateMetadataTypeFromAttribute(Type type)
        {
            Type metadataTypeAttributeType = JsonTypeReflector.GetMetadataTypeAttributeType();

            if (metadataTypeAttributeType == null)
            {
                return(null);
            }
            object obj = type.GetCustomAttributes(metadataTypeAttributeType, true).SingleOrDefault <object>();

            if (obj == null)
            {
                return(null);
            }
            return((new LateBoundMetadataTypeAttribute(obj)).MetadataClassType);
        }
Ejemplo n.º 2
0
        private static Type GetAssociateMetadataTypeFromAttribute(Type type)
        {
            Type metadataTypeAttributeType = JsonTypeReflector.GetMetadataTypeAttributeType();

            if (metadataTypeAttributeType == null)
            {
                return(null);
            }
            object obj = type.GetCustomAttributes(metadataTypeAttributeType, true).SingleOrDefault <object>();

            if (obj == null)
            {
                return(null);
            }
            IMetadataTypeAttribute metadataTypeAttribute = JsonTypeReflector.DynamicCodeGeneration ? DynamicWrapper.CreateWrapper <IMetadataTypeAttribute>(obj) : new LateBoundMetadataTypeAttribute(obj);

            return(metadataTypeAttribute.MetadataClassType);
        }