hi i need to get a record, which is related to 3 tables:
Routes -> one to one -> StartCity & EndCity
Routes -> one to many -> StopoverCity -> one to one -> City
** Sorry for my bad english
public static Route GetById(int id)
{
var result = new Route();
try
{
using (IDatabase db = DBContext.GetInstance())
{
result = db.Query<Route>().Include(x => x.StartCity).Include(x => x.EndCity)
.IncludeMany(x => x.StopoverCity).Where(x => x.Id == id).SingleOrDefault();
// i need to add other include with the StopoverCity
}
}
catch (Exception ex)
{
throw;
}
return result;
}
Solved..!