I have the following c# statement that via EF generates exactly what I'm looking for but am curious as to how I'd write this with 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);
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 };
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With