Esempio n. 1
0
        public virtual bool IsTypeToBeIntrospected(Type type)
        {
            var returnType = FilterNullableAndProxies(type);

            return(!IsTypeIgnored(returnType) &&
                   !IsTypeUnsupportedByReflector(returnType) &&
                   IsTypeWhiteListed(returnType) &&
                   (!FasterTypeUtils.IsGenericCollection(type) || type.GetGenericArguments().All(IsTypeToBeIntrospected)));
        }
Esempio n. 2
0
        public virtual Type FilterNullableAndProxies(Type type)
        {
            if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable <>))
            {
                // use type inside nullable wrapper
                return(type.GetGenericArguments()[0]);
            }

            return(FasterTypeUtils.IsProxy(type) ? type.BaseType : type);
        }
Esempio n. 3
0
        private void PopulateAssociatedActions(IObjectSpecBuilder spec, Type[] services, IMetamodelBuilder metamodel)
        {
            if (string.IsNullOrWhiteSpace(spec.FullName))
            {
                var id = spec.Identifier?.ClassName ?? "unknown";
                logger.LogWarning($"Specification with id : {id} has null or empty name");
            }

            if (FasterTypeUtils.IsSystem(spec.FullName) && !spec.IsCollection)
            {
                return;
            }

            if (FasterTypeUtils.IsNakedObjects(spec.FullName))
            {
                return;
            }

            PopulateContributedActions(spec, services, metamodel);
        }
Esempio n. 4
0
        private void PopulateAssociatedActions(IObjectSpecBuilder spec, Type[] services, IMetamodelBuilder metamodel)
        {
            if (string.IsNullOrWhiteSpace(spec.FullName))
            {
                string id = (spec.Identifier != null ? spec.Identifier.ClassName : "unknown") ?? "unknown";
                Log.WarnFormat("Specification with id : {0} as has null or empty name", id);
            }

            if (FasterTypeUtils.IsSystem(spec.FullName) && !spec.IsCollection)
            {
                return;
            }

            if (FasterTypeUtils.IsNakedObjects(spec.FullName))
            {
                return;
            }

            PopulateContributedActions(spec, services, metamodel);
        }
Esempio n. 5
0
 public virtual string GetKeyForType(Type type) =>
 FasterTypeUtils.IsGenericCollection(type)
         ? $"{type.Namespace}.{type.Name}"
         : FasterTypeUtils.IsObjectArray(type)
             ? "System.Array"
             : type.GetProxiedTypeFullName();