I have the entities Dependency, Product and Access. Dependency is connected to Product and Access. When i try to create a object set of Access with:
this.context.CreateObjectSet<Access>();
It's working... but when i try to create a object set of Product i get this error: Schema specified is not valid. Errors: The relationship 'Model.FK_Product_Dependency' was not loaded because the type 'Model.Dependency' is not available.
Any ideas?
OBS: i'm working with Database to Model, and with EF 4.0
POCO Entities:
public class Dependency
{
public virtual int Id { get; set; }
public virtual int IdParent { get; set; }
public virtual string Name { get; set; }
public virtual decimal Type { get; set; }
public virtual Dependency Parent { get; set; }
}
public class Product
{
public virtual int Id { get; set; }
public virtual int IdDependency { get; set; }
public virtual decimal Type { get; set; }
public virtual string Name { get; set; }
public virtual string Obs { get; set; }
public virtual Dependency Dependency { get; set; }
}
public class Access
{
public virtual int Id { get; set; }
public virtual int IdProfile { get; set; }
public virtual string Name { get; set; }
public virtual Profile Profile { get; set; }
public virtual ICollection<Dependency> Dependencies { get; set; }
}