So here is a link of the same question asked around 11 years ago. It's old and doesn't clear what I am looking for.
When exactly does EF open and close a database connection?
Is it opened when we create a DbContext
object or is it opened when we first make a request?
Is it closed when we hit SaveChanges()
or is it closed when we either manually dispose the object or use it inside using() {}?
I have gone through Microsoft online resources and couldn't find what I was looking for.
Thank you.