Skip to content

Database

Sam Kazerouni edited this page Nov 6, 2016 · 21 revisions

Database technology analysis

Web Services

Our Glimpse.Core Client application communicates with the Web Service ASP.NET project using HTTP Request & Response. The Web Service is the gateway for any communication with the database. The Repository layer of our application communicates with the Web Service and the Web services accesses the database using GET,POST. The responses are then received by Web Service and sent to the client application.


WebServices.png

How to connect to Microsoft Azure Database?

  1. Open Visual Studio

  2. Open Server Explorer in Views tab

  3. Right click on Data Connections in Server Explorer and Add Connection

  4. Select MySQL Database as Data source.

  5. Enter the following:

    • Server name: glimpsetarget.database.windows.net
    • User name: adming
    • Password: ******** (ask team lead)
  6. Select the database name: "glimpsedb"

  7. Click OK, you should see in Server Explorer that you are connected to Server "glimpsetarget", remote database "glimpsedb". Expand the db and you will see all tables.

How to do a migration?

In the Package Manager Console:

1-run Enable-Migrations -ContextTypeName WebServices.Models.Context where ( is a context u want to change)

2-run Add-Migration NameOfMigration

3- migration file has been added to migration folder, if its good enough go to step 5

4- modify migration file for your needs

5- run Update-Database

If you get an error that step 5 that you couldnt connect to the SQL instance, make sure WebService is the start up project.

NOTE: If any changes are done to Models, Do not forget to Publish by Right click on WebServices -> Publish -> Check parameters -> OK

Clone this wiki locally