I want call sp in t-sql from EF 6. At the same time i want load data to navigation property. On sql server side my SP Joins 2 table and returns. But EF side dont bind navigation properties.
My query code loads car data but when i want reach Engine.Name it comes null. How can i fill it ?
//query code
_context.Cars.SqlQuery("select * from Car join Engine on Cars.EngineID = Engine.EngineID")
//sample code
public class Car
{
public int ID { get; set; }
public string Name { get; set; }
public int EngineID { get; set; }
public virtual Engine CarEngine { get; set; }
}
public class Engine
{
public int EngineID { get; set; }
public string Name { get; set; }
}