Will
Will

Reputation: 10431

C# fieldinfo from a field?

Is there anyway to get a FieldInfo from a field without using something like a string with the name? Like:

class AClass
{
    String AField;
}

GetFieldInfo(GetHandle(AField));

Upvotes: 1

Views: 134

Answers (1)

SLaks
SLaks

Reputation: 887547

No; C# does not have an infoof operator.

You can implement one using expression trees.

Upvotes: 2

Related Questions