How to access current database with easy way in plugin?

8 months ago
Hello everyone.I want to acces current database(database that was created while nopcommerce instalatio n) in my plugin's controller.Is there an easy way to do this.For example Datacontext db =new Datacontext(); or something like this?
8 months ago
Hello,

There are lots of way to access it.

But best is to follow nopcommerce structure.

You have to create service for that and this service you must register at dependency register file of your plugin.

That's way you have to access db.

Hope you will understand..!!
8 months ago
what u mean at service ?
8 months ago
what is the service for current database,that i should register?