Auto Properties: DBSet vs ObjectSet

Why can we use automatic properties with DBSet, but not with ObjectSet:

public class SomeContext : DbContext
{        
    public DbSet<Address> Addresses { get; set; }
             ...
}

thank

+3
source share
2 answers

DbContext uses a conditional paradigm configuration. It discovers entities based on the DbSet properties defined in the DbContext derived class (or, in general, it discovers your model based on your code). ObjectContext makes no discoveries and is not based on conventions. It just reads your model from csdl, ssdl and msl artifacts. As a result, the ObjectContext requires the user to specify exactly what should be displayed.

+9
source

, DbContext API - , API .

+4

All Articles