I use LINQ to entity to retrive records from table and there related records from another table.
Here is my tables with relation:
And here is my LINQ to entity to retrieve records from Sensors Measure and related table alert description.
public IEnumerable<SensorsMeasure> GetSensorsMeasureWithAlertDescription()
{
return SensorObservationEntities.SensorsMeasures.Include(d => d.AlertsDescription.AlertDescription).ToList();
}
But on the query above I get this error:
A specified Include path is not valid. The EntityType 'SensorObservationModel.AlertsDescription' does not declare a navigation property with the name 'AlertDescription'.
Any idea why I get the error above and how to fix it?