Dziedziczy z DbSet <T> w celu dodania właściwości
Czy istnieje sposób dziedziczenia z DbSet? Chcę dodać kilka nowych właściwości, takich jak:
public class PersonSet : DbSet<Person>
{
public int MyProperty { get; set; }
}
Ale nie wiem, jak utworzyć instancję w moim DbContext
public partial MyContext : DbContext
{
private PersonSet _personSet;
public PersonSet PersonSet
{
get
{
_personSet = Set<Person>(); // Cast Error here
_personSet.MyProperty = 10;
return _personSet;
}
}
}
Jak mogę to osiągnąć?