SevenSpikes / api-plugin-for-nopcommerce

API plugin for nopCommerce
MIT License
286 stars 214 forks source link

Basic Usage Question #20

Open TheFigmo opened 7 years ago

TheFigmo commented 7 years ago

I am writing a WinForms app to run on an office PC to allow office staff to integrate with nopCommerce (orders, customers, products, etc.) For example, a customer calls to place an order - a popup window allows the office staff to enter a new order directly into nopCommerce.

I installed this plugin and wrote a little test app to authorize and issue some basic GETs to see it in action. It works just fine.

Now I am wondering, it seems like I have two choices for performing CRUD operations against my nopCommerce database:

  1. Use this plugin and something like RestSharp
  2. Connect to SQL Server directly and issue SQL commands against the database.

Are there any advantages to using REST vs. just talking direct to the database?

I'm new to REST and I can see the benefit for other platforms (e.g. Mobile devices). But is it worth implementing in a traditional WinForms environment? Or would I just be better off using SQL Server?

poyker commented 7 years ago

@TheFigmo

My opinion is that it doesn't matter if you are going to connect from a mobile device or from a WinForms. The benefits from using API are applicable for all kind of applications and you can read many discussions on that matter like this one for example: http://stackoverflow.com/questions/2142070/why-should-a-developer-use-web-services-instead-of-direct-connections-to-a-db

Hope this helps!

juandfranco commented 7 years ago

@TheFigmo

I am new using web api you can send that small example of connection from windows forms?

Thanks

sukeshak commented 7 years ago

Yes, please share the win forms sample if you can.