azuredevcollege/trainingdays

Day 3 - Breakout 01 - Contacts API uses local database

Freshchris01 opened this issue · 0 comments

In the Breakout 01 of day 3, the contacts API does not seem to use the configured connection string to the SQL database. Instead it uses an in memory database. This can be tested by:

  • Adding a contact with the frontend
  • Retrieving the contact with the contact api GET /contacts returns the contact
  • Restarting the contacts API webapp
  • Retrieving the contact with the contact api GET /contacts returns an empty array

It could be related to not setting the "hostingEnvironment" to production for this check:

if (HostingEnvironment.IsDevelopment())
.