How to execute SelectMany syntax in C # using a many-to-many join table?

I have the following C # statement that through EF generates exactly what I'm looking for, but I'm curious how I will write this with the query syntax:

var dealers = this.Dealers .SelectMany (d => d.Brands, (d, col) => new { Name = d.Name, Brand = col.Name, StatusId = d.StatusId }) .Where (d => d.StatusId == 1); 
+4
source share
1 answer
 var dealers = from d in Dealers from col in d.Brands where d.StatusId == 1 select new { Name = d.Name, Brand = col.Name, StatusId = d.StatusId }; 
+6
source

All Articles