Rückgabe anonymer Typ in C#

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Rückgabe anonymer Typ in C#

by Anonymous » 23 Apr 2025, 10:46

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";
}
}

Top