✅ Combining a List inside of a Select

I have an object:
    public class BackendSuccess
    {
        [Key]
        public int id { get; set; }
        public DateTime creationDate { get; set; }
        public ICollection<Label> labels { get; set; } = new List<Label>(); // BEEEEG list of base64 encoded labels
    }

And when i want to grab them all from the database, I want them combined by
creationDate
using LINQ.

For example:
creationDate:2023-12-15, labels:[{1},{2}]
and
creationDate:2023-12-15, labels:[{3},{4}]

would combine to create
creationDate:2023-12-15, labels:[{1},{2},{3},{4}]

The order of the elements in
labels
doesn't matter, I just want them combined.
Was this page helpful?