using (FacultDB db=new FacultDB()) { var ar=db.FacultyTable.Include(f=>f.students).ToList();//ошибка не удается преобразовать тип стринг так как он не является типом делегата } public class Faculty { public int facultyId{get;set;} public string facultyName { get; set;} public virtual ICollection<Person> students{get;set;} public Faculty() { students = new List<Person>(); } } public class Person { public int personId { get; set; } public string Name { get; set; } public string LastName { get; set; } public Faculty faculty { get; set; } public int Age { get; set; } } 
  • one
    ошибка не удается преобразовать тип стринг так как он не является типом делегата and writes so directly? Give the literal text of the error - Andrew NOP

1 answer 1

Check the namespaces most likely missing: using System.Data.Entity; or using System.Linq;

  • The first is missing, the Include extension is defined there. - Pavel Mayorov