private List GetTypesSupportedByConverter()

in src/DotNetWorker.Grpc/Definition/GrpcFunctionDefinition.cs [141:163]


        private List<Type> GetTypesSupportedByConverter(Type converter)
        {
            var types = new List<Type>();

            foreach (CustomAttributeData converterAttribute in converter.CustomAttributes)
            {
                if (converterAttribute.AttributeType == typeof(SupportedTargetTypeAttribute))
                {
                    foreach (CustomAttributeTypedArgument supportedType in converterAttribute.ConstructorArguments)
                    {
                        if (supportedType is { ArgumentType: not null, Value: not null } && supportedType.ArgumentType == typeof(Type))
                        {
                            if (supportedType.Value is Type type)
                            {
                                types.Add(type);
                            }
                        }
                    }
                }
            }

            return types;
        }