Relationship in table with Include does not work

Asked

Viewed 113 times

1

I can’t get my father table to include the dependent:

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

Displays the following error message:

CS1660: Cannot Convert lambda Expression to type 'string' because it is not a delegate type

  • Doesn’t it work because? Does it make a mistake? Doesn’t the data come? Please be more specific.

  • Displays this message "CS1660 Cannot Convert lambda Expression to type 'string' because it is not a delegate type"

1 answer

2


The Include that receives an expression is an extension method and is in the namespace System.Data.Entity, failed to include it.

using System.Data.Entity;
  • That’s right, I knew it was silly stuff just didn’t remember what it was, thank you very much. Just one more question as it is called Relationship really?

  • @Mr.GMSOFT It’s really relationship. Especialidade is a navigation property of the relationship.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.