-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.8.0, 2.8.1
-
Component/s: Linq
-
None
Good morning,
I'm face with this issue:
I have property Total in my MongoDB stored as Double type.
I get all Total as IQueryable<decimal> in my c# code and I call Sum but I received this error:
Truncation resulted in data loss
Code is:
var foo = bar.GetCollection<MyClass>("MyCollectionName").AsQueryable()
.Where(x => x.MyProperty == 10)
.Sum(x => x.Total);
This not works
This problem there is not if I use IEnumerable:
var foo = bar.GetCollection<MyClass>("MyCollectionName").AsQueryable()
.Where(x => x.MyProperty == 10).AsEnumerable()
.Sum(x => x.Total);
This works