I am now cutting my teeth on nHibernate and asked a question regarding dynamic access to properties in my persistent objects.
I have the following class in mine Domain:
public class Locations {
public virtual string CountryCode;
public virtual string CountryName;
}
Now, if I have a reference to the Locations object, is there a way for me to do something like this?
Locations myCountry = new LocationsRepository().GetByCountryCode("US");
myCountry.Set("CountryName", "U.S.A.");
instead of doing:
myCountry.CountryName = "U.S.A."
Without reflection?
Mr. S source
share