I'm currently getting an object based on a string property like this:
return DbContext.Products.FirstOrDefault(p => p.Route == route);
This is working correctly but I now need to get its child objects (Benefits) that are related in the model like this:
public IList<Benefit> Benefits { get; set; }
How can I get this product and all its child benefits?
Something like this, but this doesn't work:
return DbContext.Products.Include("Benefits")FirstOrDefault(p => p.Route == route);
Thanks