Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Func<Parameter> is not resolved correctly #3

Open
MistyKuu opened this issue Aug 14, 2018 · 0 comments
Open

Func<Parameter> is not resolved correctly #3

MistyKuu opened this issue Aug 14, 2018 · 0 comments

Comments

@MistyKuu
Copy link

MistyKuu commented Aug 14, 2018

Hey, it's me again.
Now Func are not resolved correctly. Unity by default resolve Func into factory of Abc class, you don't have to register Func<Abc>
public FileParserFactory(Func<TradesFileParser> tradeParserFactory)

 if (arg.ParameterType.IsClass && !arg.ParameterType.IsAbstract)
            {
                if (typeof(Delegate).GetTypeInfo().IsAssignableFrom(arg.ParameterType) || 
                    typeof(string) == arg.ParameterType ||
                    arg.ParameterType.IsEnum || 
                    arg.ParameterType.IsPrimitive)
                {
                    return IsRegistered(arg.ParameterType);
                }

                return true;
            }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant