The following code prints 2:

new MyEntity();
new MyEntity();
var distinctTypes = Query.All<MyEntity>()
    .Select(it => it.GetType())
    .Distinct()
    .Count();
Console.WriteLine(distinctTypes);

It executes sql query with distinct on Id and TypeId:

SELECT COUNT_BIG(*) AS [c01umn] FROM (SELECT DISTINCT [a].[Id], 100 AS [TypeId] FROM [dbo].[MyEntity] [a]) [b];

asked May 22 '19 at 06:41

Platonov's gravatar image

Platonov
5778


One Answer:

Hello,

Yep. This is not correct. Thank you for the report. I have added an issue for that

answered Sep 17 '19 at 05:30

Alexey%20Kulakov's gravatar image

Alexey Kulakov
77225

edited Sep 17 '19 at 05:30

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:

×5
×1
×1

Asked: May 22 '19 at 06:41

Seen: 13,656 times

Last updated: Sep 17 '19 at 05:30

powered by OSQA