Join 2 tables ORM Lite

Hi,
When i try to join 2 tables with ORM Lite and linq i get this errormessage.
I have checked both items exists in DB

I’m not sure you able to help me with this short example but i give it a try.

resource.Bookings = Db.Select<BookedTime>(Db
          .From<Booking>()
          .Where(e => e.CompanyId == resource.CompanyId)
          .Join<Booking, Service>((bo, s) => bo.ServiceId == s.Id && bo.CompanyId == s.CompanyId)
          .Select<Booking, Service>((b, se) => new BookedTime {ServiceId = se.Id, From = b.From, To = b.To, BookedSpots = b.NumberOfBookedSpots, TotalSpots = se.MaxNumberOfSpots, PauseAfterInMinutes = se.MarginAfterSlot})).ToList<IBookedTime>();

You should use an anonymous type for selecting a custom SELECT expression, try:

resource.Bookings = Db.Select<BookedTime>(Db
          .From<Booking>()
          .Where(e => e.CompanyId == resource.CompanyId)
          .Join<Booking, Service>((bo, s) => bo.ServiceId == s.Id && bo.CompanyId == s.CompanyId)
          .Select<Booking, Service>((b, se) => new { ServiceId = se.Id, From = b.From, To = b.To, BookedSpots = b.NumberOfBookedSpots, TotalSpots = se.MaxNumberOfSpots, PauseAfterInMinutes = se.MarginAfterSlot})).ToList<IBookedTime>();

Thx Mythz, i will try this!