I wonder if I can do assignment using TResult<in T, out TResult>
I can retrieve the value of the property of a class instance with that delegate as below:
class Program
{
class MyClass
{
public int MyProperty { get; set; }
}
static void Main(string[] args)
{
Func<MyClass, int> orderKeySelector = o => o.MyProperty;
MyClass mc = new MyClass() { MyProperty = 3 };
int val = orderKeySelector.Invoke(mc);
}
}
I want to assign some value to MyProperty using orderKeySelector and MyClass instance. Any Ideas?