What is the good practice on passing values(datatype and fieldname) on entity.GetAttributeValue<T>(fieldname)
. Currently I see something like : entity.GetAttributeValue<string>(address)
. Is there any better way of doing this without specifically pass those prameters(string,address) on .GetAttributeValue
method?
Currently I have a code like this:
var prop = typeof(PersonAddress).GetProperties();
string address;
foreach(var p in prop)
{
address = entity.GetAttributeValue<p.PropertyType>(p.name)
}
but the p.PropertyType
is not accepted as a reference type in GetAttributeValue<T>