1

i have write this query for getting sum of marks using linq c# "System.NotSupportedException: LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression.".

write this query :

int Marks = 0; 
 public string maths {get;set} 
Marks = db.Users.Where(t => t.userid == t.Markstb.id).Sum(t => Convert.ToInt32(t.Markstb.maths)); // here getting error 

any one know how can do that please let me know?

coderwill
  • 804
  • 3
  • 16
  • 38

0 Answers0