Hi!

I've two small feature requests:

Add two overloads: Now we have

public T GetProperty<T>(string fieldName)
public void SetProperty<T>(string fieldName, T value)

Those overloads will be useful in reflection scenarii, where it is not possible to define type in code but a type object is available

public object GetProperty(string fieldName, Type t)
public void SetProperty(string fieldName, object value, Type t)

Be compatible with Structure IE be able to call :

person.SetProperty<string>("Address.Street", "1 foo road")

Regards,

This thread was imported from our support forum. The original discussion may contain more detailed answer.

asked Apr 21 '10 at 09:09

olorin's gravatar image

olorin
358878792


One Answer:

Hello olorin,

the first one is already done: use Entity[string fieldName] indexer for getting and setting values.

As for the second one, we decided not to support such kind of syntax as it lead to possible business logic violation (I mean setting structure field value without even instantiating of structure instance which might contain arbitrary logic & behavior, etc.).

answered Apr 21 '10 at 10:25

Dmitri%20Maximov's gravatar image

Dmitri Maximov
22111211

olorin wrote: That's right, I didn't thought of that.

Thanks for the tip!

(Apr 21 '10 at 10:25) Editor Editor's gravatar image

You are welcome!

(Apr 21 '10 at 10:25) Dmitri Maximov Dmitri%20Maximov's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA