mikha
asked on
C#, asp.net MVC, sql server, LINQ
say, i have a class/object, sample below. I have bunch of fields which holds the total for assignment, exams or projects.
Now if I want to find out total of all the assignments fields, is there easier way to select all the assignment fields from this object and to add them up.
public class Course {
Public String Name {get; set; }
public decimal? Assignment1_Total {get; set; }
public decimal? Assignment2_Total {get; set; }
public decimal? MidTerm1_Total {get; set; }
public decimal? MidTerm2_Total {get; set; }
public decimal? Project1_Total {get; set; }
public decimal? Project2_Total {get; set; }
........
}
Now if I want to find out total of all the assignments fields, is there easier way to select all the assignment fields from this object and to add them up.
public class Course {
Public String Name {get; set; }
public decimal? Assignment1_Total {get; set; }
public decimal? Assignment2_Total {get; set; }
public decimal? MidTerm1_Total {get; set; }
public decimal? MidTerm2_Total {get; set; }
public decimal? Project1_Total {get; set; }
public decimal? Project2_Total {get; set; }
........
}
Homework?
ASKER
no. i simplified the use case.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.