Model:

[HierarchyRoot]
public class TestEntity : Entity
{
    [Field, Key]
    public Guid Id { get; set; }

    [Field]
    public decimal Dec { get; set; }
}

Test:

new TestEntity
{
    Id = Guid.NewGuid(),
    Dec = 274486.4m
};

var fromQuery = Session.Current.Query.All<TestEntity>().Sum(x => Math.Round(x.Dec, 2));
var fromList = Session.Current.Query.All<TestEntity>().ToList().Sum(x => Math.Round(x.Dec, 2));

Assert.True(fromQuery == fromList, string.Format("{0} != {1}", fromQuery, fromList));

Exception:

274486.4000000000200000000 != 274486.40

DO 5.0.7

MSSQL 2012

asked Oct 11 '16 at 00:59

Anton%20Guschin's gravatar image

Anton Guschin
73273035

edited Oct 11 '16 at 01:00

DO 5.0.10, same error

(Oct 11 '16 at 06:26) Anton Guschin Anton%20Guschin's gravatar image

One Answer:

Hello Anton

I will figure out what happens in that case. Thank you for the report.

answered Nov 09 '16 at 03:10

Alexey%20Kulakov's gravatar image

Alexey Kulakov
51215

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×569
×11
×1

Asked: Oct 11 '16 at 00:59

Seen: 1,216 times

Last updated: Nov 09 '16 at 03:10

powered by OSQA