I'm passing a DBSet as a parameter into a method, and also passing the DbContext so that I can call SaveChanges().
Is there any way to call SaveChanges() or an equivalent on the DbSet object itself?
I'm passing a DBSet as a parameter into a method, and also passing the DbContext so that I can call SaveChanges().
Is there any way to call SaveChanges() or an equivalent on the DbSet object itself?
This is not possible without creating your own abstraction, such as a Repository. An instance of DbSet does not have a reference to the parent DbContext.