I am trying to compute the sum of the difference of two columns:
var result = model.TableExample
.Where(condition here)
.Select(s => s.Column1 - s.Column2)
.Sum();
but it is rising an exception:
Index and length must refer to a location within the string
I can't understand this. There is no string anywhere, columns are integer in model and database. Is there something wrong?
I am using MySql provider.