Hi, this is my view model. So it is work for static property name.
for example;
public class BankaBazliInfo
{
private string bankName;
private double tryTotal;
private double usdTotal;
private double eurTotal;
private double gbpTotal;
private double chfTotal;
private double cadTotal;
public string BankName
{
get { return bankName; }
set { this.bankName = value; }
}
public double TryTotal
{
get { return tryTotal; }
set { this.tryTotal = value; }
}
public double UsdTotal
{
get { return usdTotal; }
set { this.usdTotal = value; }
}
public double EurTotal
{
get { return this.eurTotal; }
set { this.eurTotal = value; }
}
public double GbpTotal
{
get { return gbpTotal; }
set { this.gbpTotal = value; }
}
public double ChfTotal
{
get { return chfTotal; }
set { this.chfTotal = value; }
}
public double CadTotal
{
get { return cadTotal; }
set { this.cadTotal = value; }
}
public BankaBazliInfo(string bankName, double tryTotal, double usdTotal, double eurTotal)
{
this.bankName = bankName;
this.tryTotal = tryTotal;
this.usdTotal = usdTotal;
this.eurTotal = eurTotal;
}
}
Now, i want to change model like with dynamic properties. Beacaue i seted my viewmodel as six currency name, but it is changeable like 5 or 7 currency, maybe like Dictionary for example;
Dictionary<string, Dictionary<string, double>>() => Dictionary<BankName, Dictionary<CurrenyName, Total>>()