Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group by multiple properties Extension methods error. #5887

Closed
jotab123 opened this issue Jun 28, 2016 · 4 comments
Closed

Group by multiple properties Extension methods error. #5887

jotab123 opened this issue Jun 28, 2016 · 4 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@jotab123
Copy link

Hi!
I think I found and error working on group by queries with multiple properties using Linq.Dynamic.Core library https://github.com/StefH/System.Linq.Dynamic.Core that I believe is an EntityFramework Core error because the output is correct in memory List query but not in sql server database query.

Full example project: https://github.com/jotab123/GroupByError

Model

    [Table("Element")]
    public class Element
    {
        [Key]
        public int Id { get; set; }
        public double Attribute1 { get; set; }
        public double Attribute2 { get; set; }
    }

Test

 //List test.
var resultList1 = ElementsList.GroupBy(el => new { el.Attribute1, el.Attribute2 });     //CORRECT
var resultList2 = ElementsList.AsQueryable().GroupBy("new(Attribute1, Attribute2)");    //CORRECT

 //Database tests.
var resultDb1 = db.Element.GroupBy(el => new { el.Attribute1, el.Attribute2 });         //CORRECT
var resultDb2 = db.Element.GroupBy("new(Attribute1, Attribute2)");                      //WRONG

EF Core version: 1.0 Final Release
Operating system: Windows 10
Visual Studio version: VS 2015

Other details about my project setup:
System.Linq.Dynamic.Core

@rowanmiller
Copy link
Contributor

Can you elaborate on what "wrong" means. Do you see an exception, incorrect results, unexpected SQL, etc.?

@jotab123
Copy link
Author

jotab123 commented Jun 29, 2016

Last query returns incorrect results. resultList1, resultList2 and resultDb1 return 4 groups, resultDb2 returns 10 groups. I'm in contact with Stef Heyenrath, main developer of Linq Dynamic Core library, about this problem. He tried it in Entity Framework 6.1.3 and works fine.

More info in this thread: zzzprojects/System.Linq.Dynamic.Core#31

@smitpatel
Copy link
Contributor

Same cause as #4581

@smitpatel
Copy link
Contributor

@jotab123 - #6271 fixed this. Feel free to re-open if you still see the issue after fix.

@smitpatel smitpatel added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Aug 10, 2016
@ajcvickers ajcvickers modified the milestones: 1.1.0-preview1, 1.1.0 Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

4 participants