So this is the full error message i receive. (see title)
I am hosting an ASP.NET Web API on Azure, as well as an Azure SQL Database. I have connected my .edmx to the Azure Database, so it shows me the models from my hosted DB with no problems.
My huge frustration is the fact that i cannot send an API get request call whatsoever!
[EnableCors(origins: "*", headers: "*", methods: "*")]
[System.Web.Http.Route("~/api/Admin/getTest")]
[System.Web.Http.HttpGet]
public List<CARCOLOUR> getTest()
{
INF370KODEITEntities db = new INF370KODEITEntities();
db.Configuration.ProxyCreationEnabled = false;
List<CARCOLOUR> testData = db.CARCOLOURs.ToList();
return testData;
}
Here is my connection string (omitted password and username for obvious reasons with '')
<connectionStrings>
<add name="INF370KODEITEntities" connectionString="metadata=res://*/Models.CarwashModel.csdl|res://*/Models.CarwashModel.ssdl|res://*/Models.CarwashModel.msl;provider=System.Data.SqlClient;provider connection string="data source=kodeit-apidbserver-database.database.windows.net;initial catalog=KODEIT_API_db;persist security info=True;user id='';password='';MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
This call just gets a list of car colours. But each time I run the call on Postman, i get that frustrating 500 error. Thanks to this I could luckily find a fix to show more information. But am uncertain on what to do to fix it.
Hence my question, how do i fix the "Unintended Code First" error I am receiving?
Disclaimer: I am a university student (a.k.a very novice programmer), as such i apologize in advance if I'm using the incorrect jargon, and/or am not specific/clear enough.