Using DbQuery in linq join -> Entity Framework Core

c# entity-framework-core linq

Question

I have a query (DeliveryDates) and a dbset (Products) in EF Core and I want to join them in linq.

I tried this:

var list = await (from d in _financeContext.DeliveryDates
                  join p in _financeContext.Products on d.ProductId equals p.ProductId
                  select new
                          {
                          }).ToListAsync();

But I get this error:

Could not find an implementation of the query pattern for source type 'DbQuery'. 'Join' not found. (CS1936)

Is there anyway to join a dbquery and a dbset in linq ?

1
0
7/7/2019 1:37:27 PM

Popular Answer

join is a Linq function. It looks like you don't add a using to System.Linq;

using System.Linq;

var list = await (from d in _financeContext.DeliveryDates
              join p in _financeContext.Products on d.ProductId equals p.ProductId
              select new
                      {
                      }).ToListAsync();
0
7/7/2019 2:45:11 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow