Relationship in table with Include does not work

1

I can not make my parent table include the dependent:

var medicos = TabelaMedico.Include(m => m.Especialidade).ToList();

It displays the following error message:

  

CS1660: Can not convert lambda expression to type 'string' because it is not a delegate type

    
asked by anonymous 27.07.2017 / 18:54

1 answer

2

The Include that receives an expression is an extension method and is in the namespace System.Data.Entity , has not included it.

using System.Data.Entity;
    
27.07.2017 / 19:00