consider I have this simple c#
code:
dynamic obj = new ExpandoObject();
obj.FirstName = "John";
obj.LastName = "Doe";
I want to add method which will return full name, John Doe
in this case.
I know the following line will work, but not sure if it is the best aproach
obj.GetFullName = new Func<string>(() => $"{obj.FirstName} {obj.LastName}");
Is there any other way to access dynamic object
instance through the GetFullName
method?