I have a Func in my code that’s declared like this:
Func<string, int, bool> Filter { get; set; }
How can I reach the string and the int variables that are parameters of the Func in order to use them in my code?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The parameters only exist when the function is called… and they’re only available within the function. So for example:
Here, the value “yes this is long” is the value of the
textparameter while the delegate is executing and likewise the value 5 is the value of thelengthparameter while it’s executing. At other times, it’s a meaningless concept.What are you really trying to achieve? If you could give us more context, we could almost certainly help you better.