0

I have a function

public Tuple<bool, string> check()
{

.
.
return new Tuple<bool, string>(true, null);
}

Now I want to call this check() function in my main code. Whats the right way to do? I was thinking to do the following. but it does not work.

Tuple<bool, string> chk = new Tuple<bool, string>(check());

2 Answers 2

4

You don't need to create a new object as part of your call to the function. Just use this:

Tuple<bool, string> chk = check();
Sign up to request clarification or add additional context in comments.

Comments

2

Methods are called with the identifier of who owns the method. You return type is a Tuple, but it is not the Tuple who owns the Check method.

The object who owns the method in your case is certainly this in that context.

So call it this way instead :

var chk = this.check();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.