I have the following table structure:
I want to retrieve all funds for provided reportId. I did it this way:
va
You don't use Include with custom projections. They are alternative approaches to generating results. So just run
var result = _context.FundsInReport
.Where( fr => fr.ReportId == someId )
.Select(fr => new FundsResponse()
{
FundId = fr.Fund.Id,
LegalName = fr.Fund.LegalName,
HeaderName = fr.Fund.HeaderName,
PortfolioCurrency = fr.Fund.PortfolioCurrencyId,
BaseCurrency = fr.Fund.BaseCurrencyId,
FileName = fr.Fund.FileName,
Locked = fr.Fund.Locked
}).ToList();