如何从已加载的集合中加载相关实体:
收藏:
public class Ad
{
// Primary properties
[Key]
public int Id { get; set; }
private ICollection<Feature> _features;
public virtual ICollection<Feature> Features
{
get { return _features ?? (_features = new HashSet<Feature>()); }
set { _features = value; }
}
}
特点:
public class Feature
{
// Primary properties
public int Id { get; set; }
public string Name { get; set; }
// Navigation properties
public virtual ICollection<Ad> Ads { get; set; }
public Keyword Keyword { get; set; }
}
关键字:
public class Keyword
{
// Primary properties
public int Id { get; set; }
public string Name { get; set; }
public bool IsActive { get; set; }
}
我需要为广告中的所有功能加载实体关键字。
谢谢