Ejemplo 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)));
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo n.º 5
0
 public virtual string GetKeyForType(Type type) =>
 FasterTypeUtils.IsGenericCollection(type)
         ? $"{type.Namespace}.{type.Name}"
         : FasterTypeUtils.IsObjectArray(type)
             ? "System.Array"
             : type.GetProxiedTypeFullName();