G
Guest
I have aa situation and i don't know if what i want to do is possible.
I have a class named Account with some properties and i set values for these
properties like this.
public void foo()
{
account.BillingCity = "Wichita";
account.BillingCountry = "US";
account.BillingState = "KA";
// some more properties
account.create();
}
Is it possible to do something like this
public void bar()
{
string[] propName = {BillingCity ,BillingCountry,BillingState }
for( int i=0; i< propName.length; i++ )
{
account.propName = someVal;
}
account.create();
}
what i want to do is to have some list of properties names and for those
names set the value of that propertie.
I do not want to use soem switch/case or if/else statements
I have a class named Account with some properties and i set values for these
properties like this.
public void foo()
{
account.BillingCity = "Wichita";
account.BillingCountry = "US";
account.BillingState = "KA";
// some more properties
account.create();
}
Is it possible to do something like this
public void bar()
{
string[] propName = {BillingCity ,BillingCountry,BillingState }
for( int i=0; i< propName.length; i++ )
{
account.propName = someVal;
}
account.create();
}
what i want to do is to have some list of properties names and for those
names set the value of that propertie.
I do not want to use soem switch/case or if/else statements