Product
Store demo
Showcase
Features
Why for developers
Why for store owners
Industries
Fashion
Health & Beauty
Food & Beverage
Automotive
Industrial & Scientific
Furniture
B2B eCommerce
International
Downloads
Download nopCommerce
Marketplace
Translations
Copyright removal key
Mobile application
Web API
Support & services
Training
Documentation
Community forums
Premium support services
Request a quote
Contact us
Partners
English
English
Español
Deutsch
Russian
Français
Italiano
Português
Türkçe
简体中文
日本語
Tiếng Việt
Get started
Shopping cart
My account
Log in
Register
Home
>
Forums
>
General
>
Development
>
How to access current database with easy way in plugin?
How to access current database with easy way in plugin?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Xxxzzz
Total Posts:
1
Karma:
5
Joined:
3/13/2019
Location:
United States
Posted:
5 years 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?
smi10
MVP
Certified Developer
Total Posts:
981
Karma:
8028
Joined:
2/10/2017
Location:
India
Posted:
5 years 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..!!
bidzinagoginashvili
Total Posts:
13
Karma:
61
Joined:
3/5/2019
Location:
Georgia
Posted:
5 years ago
what u mean at service ?
bidzinagoginashvili
Total Posts:
13
Karma:
61
Joined:
3/5/2019
Location:
Georgia
Posted:
5 years ago
what is the service for current database,that i should register?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Still have questions or need help?
.
Premium support services
.
Get dedicated support from the nopCommerce team with a guaranteed response within 24 hours.
.
Online course for developers
.
Get the practical and technical skills you need to run and customize nopCommerce websites.