Is there any way to using reflection in .net to get a property’s value using a path like so…
type t {
id : int
name : string
}
type s {
id : int
st : t
{
let a = {id = 1; {id = 2; name = "foo"}}
a.getType().getProperty("st.name")
Sorry for the F#. This doesn’t work obviously but it illustrates what I’m trying to do. I could write a recursive algorithm for this but does anybody know of a mechanism in the API to accomplish this?
You can use DataBinder.Eval to dynamically evaluate path expressions (although this will mean adding a dependency to System.Web):
http://msdn.microsoft.com/en-us/library/4hx47hfe.aspx
C# Example: