1

I'm using ASP.NET MVC and at the bottom of my controller is the standard Dispose method that disposes the db context automatically for you. I need to pass the db context from this controller to a service class for use to access the database from that class.

My questions is, if I pass the db context to this service class, will the automatic dispose method in my controller still dispose of this db context?

user7560542
  • 527
  • 1
  • 5
  • 14
  • 1
    See the discussion here: https://stackoverflow.com/questions/32472159/proper-way-to-use-dbcontext-global-or-pass-as-parameter – devlin carnate Jun 21 '18 at 20:11

0 Answers0