Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

Extend C# language feature

$
0
0

if we see Linq syntax in C# we will meet many of them specify property of an object, like below

from o in db.Orders where o.OrderID = 3 select o;

My question is simple, how we know what property/field beside method is specified by the code ?

Suppose you have a method with some parameters like below

public void MyMethod(int x) {}

and invoked by user like MyMethod(MyObject.MyProperty);

Is possible we know what acctually passed to the method (what property/field of an object), not just the value itself ?

Yes it is possible using delegate, but delegate is for a method. Is there same like delegate but for field or property ?



It's hard to be advanced programmer


Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>