How can I calculate the sum of fields N1 to N5 in the Trans model?
public class Trans
{
public int id { get; set; }
public int N1 { get; set; }
public int N2 { get; set; }
public int N3 { get; set; }
public int N4 { get; set; }
public int N5 { get; set; }
}
...
trans: Trans = new Trans();
trans.N1 = 1;
trans.N2 = 2;
trans.N3 = 3;
trans.N4 = 4;
trans.N5 = 5;
...
Then, we want to calculate trans.N1 + trans.N2 + ... + trans.N5
Is there a way to do this?