Store Procedure in Entity Framework (PostgreSQL)

Всем привет

У меня есть хранимая процедура, мне нужно сделать этот же запрос, в C#, через EF.

select r1. RESERVATIONID,r1.corpAccount, 
isnull(flt.amount,0)  as amount
INTO #ROOMCHARGES1
from FOLIO_LEDGER_TRANS flt
   
join ACCOUNT_RESERVATION_FOLIO_XREF arfx on 
       flt .folioid = arfx.folioid        
and    flt.LedgerAccountId in 
          (select ledgerAccountID from client_ledgerAccount_lov where clientid =@ClientID     
            and ledgerAccountTypeId in(2) 
      ) 
and   -- etc

Тут я пытаюсь сделать join который есть в процедуре, но почему-то он выдает ошибку и я не могу работать с данными дальше. Может кто подскажет, где я ошибся со вторым join?

public IEnumerable<NetRevenue> GetRoomRevenue(something)
        {
            return _reportsDbContext.Reservations.AsNoTracking().
            Join(_reportsDbContext.Accounts.AsNoTracking(),
            reservation => reservation.ReservationId,
            corpAccount => corpAccount.AccountTypeId,
            (reservation, corpAccount) => new { reservation, corpAccount })
                .Join(Contracts.Common.AccountFolios) on(x=>x.);

                )
        }

Ответы (0 шт):