Geben Sie das erste untergeordnete Objekt einer Unterliste von Objekten zusammen mit dem übergeordneten Objekt zurück, oC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Geben Sie das erste untergeordnete Objekt einer Unterliste von Objekten zusammen mit dem übergeordneten Objekt zurück, o

Post by Anonymous »

Ich habe zwei Funktionen wie unten gezeigt und möchte die Antwort „Funktion2“ im Antworttyp „Funktion1“ zurückgeben.

Code: Select all

    public class1 function()
{

Var response=function2();

//I want to return first object of class 2 along with parent object
of class1 without loosing the parent and first object data of class2.
currently I am getting the error saying can't convert list to single object.

Return class1

}

Public class1 function2()
{

Return class1

}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post