Wednesday 24 September 2014

Return multiple value with Tuple class

      
Create method to return multiple value

  public Tuple<int, string> testMethod()
        {
            return Tuple.Create(10, "Success");
        }
        public Tuple<int, string, bool> testMethod1()
        {
            return Tuple.Create(10, "Success", true);

        }




Call Method :

          Tuple<int, string> tpl = testMethod();
           int i = tpl.Item1;
           string sr = tpl.Item2;

No comments:

Post a Comment