© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
221 replies
Yashogi

LInq Combine duplicates

Hey everyone, trying to figure out how to combine my dates together so that it doesn't separate the data.
This is what I am currently working with
    Stores
        .Select(x => new
        {
            City = x.City,
            Location = x.Location,
            Sales = Orders.Where(o => x.StoreID == o.StoreID && o.OrderDate.Month == 12).OrderBy(o => o.OrderDate.Day)
            .Select (s => new 
            {
                Date = s.OrderDate,
                ProductSales = s.SubTotal,
                GST = s.GST
            })
        }).Dump();
    Stores
        .Select(x => new
        {
            City = x.City,
            Location = x.Location,
            Sales = Orders.Where(o => x.StoreID == o.StoreID && o.OrderDate.Month == 12).OrderBy(o => o.OrderDate.Day)
            .Select (s => new 
            {
                Date = s.OrderDate,
                ProductSales = s.SubTotal,
                GST = s.GST
            })
        }).Dump();
remove_dupes.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

LINQ
C#CC# / help
2y ago
❔ LINQ
C#CC# / help
3y ago
Linq+File
C#CC# / help
3mo ago
LINQ help
C#CC# / help
2y ago
Next page