Im working with ASP.NET WebAPI & EntityFramework. I noticed that I could create API controller with VS template based one of my entities. The controller automatically has methods PUT, GET, POST, DELETE. Its very usefull and makes life easier.
But, the db connection initial in every single controller, I mean, every controller has DB connection object.
(for example: ExampleEntities db = new ExampleEntities())
Is that the right way to work? Or should I create a BL or something to wrap the DB, and the controllers will access the db via BL?
tnx!