Rückgabe anonymer Typ in C#C#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Rückgabe anonymer Typ in C#

Post by Anonymous »

Ich habe eine Abfrage, die einen anonymen Typ zurückgibt, und die Abfrage befindet sich in einer Methode. Wie schreibt man das: < /p>

Code: Select all

public "TheAnonymousType" TheMethod(SomeParameter)
{
using (MyDC TheDC = new MyDC())
{
var TheQueryFromDB = (....
select new { SomeVariable = ....,
AnotherVariable = ....}
).ToList();

return "TheAnonymousType";
}
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post