I am building my data layer class library with Entity Framework 6.1. I created my context and am trying to do the model builder code (or is it derived when I do Add-Migration?
Anyway, I have seen quite some examples but when I try to use .HasMany or .WithRequired on a modelBuilder.Entity() instance they don't appear in Intellisense. What am I missing?
The
Entity<T>
method is generic (DbModelBuilder.Entity), so, you need to specify theT
type you want to start your configuration, for example:And the configuration on the
OnModelCreating
method would be: