I have three tables and I am having trouble getting to the bottom of this one.
So I am given the ID of a vehicle, and I need to write a query to output a list of its seat rows.
Vehicle
{
id,
vehicleTypeId,
color
}
VehicleType
{
id,
type,
}
VehicleSeats
{
id,
description
}
This is as far as my query has gotten and I am just as a complete loss on getting this one out right. I need it to output a list of seats, not a list of types, I just do not know how to take it deeper.
var vehicleSeatsList = (from c in db.Vehicle
where c.VehicleTypeID == id
select c).ToList();
Here was my final solution. I have yet to plug it in to know if it is right. I was being a dummy. Dont know why I wasn't thinking of just doing a join...
var VehicleTypeSeats = (from c in db.VehicleTypeSeats
join a in db.Vehicles on c.AircraftTypeID equals a.VehicleTypeID
where c.VehicleTypeID == id
select c).ToList();