-3

I was asked if it is possible to create an API in asp.net MVC C#, Where the MVC program will use the API to call select data from an existing websites MySQL database and display it, then be able to put this data into a SQL database. My knowledge on APIs is limited and what I am looking for out of this question is:

  1. Is it possible?

  2. If so is there any good tutorials, videos or other documentation you could link that would help to achieve this?

  3. If it is not possible - what other options are there to do this? If any.

I have spent a good bit of time searching around to try find something on this but I don't seem to be able to find anything and am not sure where to look.

(Right now, to try to create this I have a MySQL database done in phpMyAdmin and a database done in SQL Server 2012 that are as identical as I could make them, I have no code as I don't know where to start and I am using Visual Studios 2013)

Leandro Bardelli
  • 10,561
  • 15
  • 79
  • 116

2 Answers2

1

Yes, it's possible. You should read the MVC guide from Microsoft and work with Entity Framework but with MySQL:

StackOverflow question about it: Using MySQL with Entity Framework

MVC Guide from Microsoft: http://www.asp.net/mvc/overview/older-versions/getting-started-with-aspnet-mvc4/intro-to-aspnet-mvc-4

Community
  • 1
  • 1
Leandro Bardelli
  • 10,561
  • 15
  • 79
  • 116
1

If you want to use ORM like EF6 you can check here If you want to go for plain SQL you can check this one

Just follow one of these tutorials and you'll be up and running very soon. I would go for plain SQL version at first to have more control over data flow and also to avoid and difficulties with Entity Framework configuration.

twinmind
  • 1,440
  • 13
  • 21