[SOLVED] What is happening in this snippet?
My guess is: since
AppDbContext
inherits from DbContext
, it also inherits the ctor and all the parameters that the ctor takes. This way, AppDbContext
's ctor is being overwritten so that it only has the options
parameter from its parent class. Is this correct?
2 Replies
It's going to take your options object and pass it into the base class constructor that accepts an options parameter, once the base class constructor is finished it will run the body of the
AppDbContext
constructor
If there is no empty constructor in your base class then this is mandatory, if there is then this is an optional way of determining which constructor to use.Alright, thanks a bunch!