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

Break anonymous object creation when there are more than two properties #753

Closed
belav opened this issue Nov 11, 2022 · 1 comment · Fixed by #755
Closed

Break anonymous object creation when there are more than two properties #753

belav opened this issue Nov 11, 2022 · 1 comment · Fixed by #755
Milestone

Comments

@belav
Copy link
Owner

belav commented Nov 11, 2022

Object initializers automatically break when they have more than two properties.

        var x = new Thing
        {
            Post = post,
            Blog = blog,
            Some = count
        };

Query syntax should do the same for the select new in this block

        var result = await(
                from post in dbContext.Posts
                join blog in dbContext.Blogs on post.BlogId equals blog.Id
                let count = dbContext.Posts.Count(p => p.Name == post.Name)
                where post.Id == 1
                select new { Post = post, Blog = blog, SamePostNameCount = count }
            )
            .AsNoTracking()
            .FirstAsync();
@belav belav added this to the 1.0.0 milestone Nov 11, 2022
@belav
Copy link
Owner Author

belav commented Nov 11, 2022

This came from #750

@belav belav changed the title Break query select statements similar to object initializers. Break anonymous object creation when there are more than two properties Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant