public void Can_save_and_query_with_implicit_services_and_explicit_config() { var optionsBuilder = new DbContextOptionsBuilder(); optionsBuilder.UseInMemoryDatabase(); using (var context = new ImplicitServicesExplicitConfigBlogContext(optionsBuilder.Options)) { context.Blogs.Add(new Blog { Name = "The Waffle Cart" }); context.SaveChanges(); } using (var context = new ImplicitServicesExplicitConfigBlogContext(optionsBuilder.Options)) { var blog = context.Blogs.SingleOrDefault(); Assert.NotEqual(0, blog.Id); Assert.Equal("The Waffle Cart", blog.Name); context.Blogs.RemoveRange(context.Blogs); context.SaveChanges(); Assert.Empty(context.Blogs); } }