Сначала я использую Entity Framework Code. У меня есть 2 очень похожих класса с виртуальным свойством ICollection. Вот один из них с классом коллекции:Как я могу вернуть EnityCollection из виртуального ICollection?
public class Name
{
public int Id{ get; set;}
[MaxLength(64)]
[Index(IsUnique = true)]
[Required]
public string Value { get; set; }
public virtual ICollection<NameVariant> Variants { get; set; }
}
public class NameVariant
{
public int Id{ get; set;}
[MaxLength(64)]
[Index(IsUnique = true)]
[Required]
public string Value { get; set; }
public int ParentId { get; set; }
public virtual Name Parent { get; set; }
}
я EntityCollection из вариантов в одном случае и HashSet в другой. От чего это зависит? Как я могу получить EnityCollection из обоих классов?