Link to home
Start Free TrialLog in
Avatar of mikha
mikhaFlag for United States of America

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; }
     ........
}
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Homework?
Avatar of mikha

ASKER

no. i simplified the use case.
ASKER CERTIFIED SOLUTION
Avatar of it_saige
it_saige
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial