public override IImmutableDictionary <string, ITypeSpecBuilder> Process(IReflector reflector, Type type, IMethodRemover methodRemover, ISpecificationBuilder specification, IImmutableDictionary <string, ITypeSpecBuilder> metamodel)
        {
            if (typeof(IEnumerable).IsAssignableFrom(type) && !FasterTypeUtils.IsSystem(type))
            {
                MethodInfo method = FindMethod(reflector, type, MethodType.Object, RecognisedMethodsAndPrefixes.GetEnumeratorMethod, null, Type.EmptyTypes);
                if (method != null)
                {
                    methodRemover.RemoveMethod(method);
                }
            }

            return(metamodel);
        }
コード例 #2
0
        public override IImmutableDictionary <string, ITypeSpecBuilder> Process(IReflector reflector, Type type, IMethodRemover methodRemover, ISpecificationBuilder specification, IImmutableDictionary <string, ITypeSpecBuilder> metamodel)
        {
            var currentType = type;

            while (currentType != null)
            {
                if (FasterTypeUtils.IsSystem(currentType))
                {
                    ProcessSystemType(currentType, methodRemover, specification);
                }

                currentType = currentType.BaseType;
            }

            return(metamodel);
        }
コード例 #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);
        }