Changes to use AddDbContext method

@HaoK @ajcvickers @glennc