hackgvl / trolley-tracker-api-dot-net

API for tracking Greenville's trolleys with .NET
MIT License
4 stars 6 forks source link

Change Entity Framework context usages to 'using' pattern #39

Closed bikeoid closed 6 years ago

bikeoid commented 6 years ago

Change all database context usages to 'using' pattern to ensure that the connection can be closed by the framework in every case. Otherwise if the database connection pool fills and gets stuck, it is difficult to prove that there is a server problem since there can be several reasons for an Entity Framework query not to automatically close (exceptions, a break statement, etc)