I have an application of WindowsAplication in C # , it is developed in N-Layers . The method in the data layer to get a table did not give problems:
public List<styh_m_005_cultivo> GetAll()
{
using (var context = new TermometroDbContext())
{
return (
from entity in context.styh_m_005_cultivo
select entity
).ToList();
}
}
But when adding method include
:
public List<styh_m_005_cultivo> GetAll()
{
using (var context = new TermometroDbContext())
{
return (
from entity in context.styh_m_005_cultivo
select entity
).Include(c => c.styh_m_006_agricultor)
.Include(c => c.styh_p_004_recinto).ToList();
}
}
A System.TypeLoadException
occurs:
Unable to load type
System.Data.Entity.DbExtensions
of assemblyEntityFramework
,Version=6.0.0.0
,Culture=neutral
,PublicKeyToken=b77a5c561934e089
.