This project has moved and is read-only. For the latest updates, please go here.

dynamic methods

Jan 20, 2011 at 2:28 PM

Hi, I just started looking at your library (came from Orchard), and I am doing some meta-data programming, and was wondering if following is possible.  I want to be able to add a method(s) to dynamic type that are stored as c# code in meta-data.  So basically I guess, class should be able to accept number of Expressions. Is this possible? I am not up to date with "dynamic" but I see great opportunity for what I am working on.



Jan 20, 2011 at 4:24 PM

It looks like I could do it by creating new ClayBehavior. I am on the right track? I could have another factory that is used to get clay objects, that would setup all props and methods based on the metadata of the requested type. What do you think?

Jan 21, 2011 at 7:32 PM

Yes, that sounds like the right approach although I think there are limitations in C#4/CRL4 with regards to how you can mix Lambdas and dynamic.

Jan 23, 2011 at 2:48 PM

I uploaded a fork that allows me to attach methods to dynamic clay object as delegates (func/action). Now I have to figure how to take meta-data that I have, create expression and than somehow convert it to Func/Action. Hmmm, time to read up on expression tress.

May 24, 2011 at 3:13 AM

Hi epitka,

It's been a while since you posted this comment in the discussions - did you ever find a way to attach methods to the dynamic clay object like you were referring to?  Just curious!