I am exploring Azure mobile app services in combination with my Xamarin Forms mobile app, and I have created a mobile app service, sql server, and sql database.
Anyway, after many hours, I have been bested, and am looking for some help. I have created a basic table inside the DB for my app, called Person, with Id, FirstName, LastName columns. The columns are all nvarchar(50) just for ease and testing. I have confirmed that the database/table exist with SQL Server Management Studio and done the necessary testing of selecting, inserting, etc from that table using SSMS.
From everything I have read, I should be able just do the following and have everything work:
Add the following to my PersonController class:
public static MobileServiceClient MobileService = new MobileServiceClient("https://somethinghere.azurewebsites.net");
Create a Person class with Id, FirstName, LastName.(all strings)
Last add the code supplied, and modified to be "Person", from the azure portal to connect the db to an existing app which is:
//CurrentPlatform.Init(); Person person = new Person{ Id = "a1", FirstName = "John", LastName = "Doe" }; await MobileService.GetTable<Person>().InsertAsync(person);
Note: The guide says to use CurrentPlatform.Init() but I cant find any information on this and it throws an error even with 'using Microsoft.WindowsAzure.MobileServices;' so I commented it out.
I am trying to figure out what I am doing wrong. I get the following two errors, seem to do with the GetTable not getting any data returned:
1. //This is an error I see when I highlight over the breakpoint at the GetTable<Person> line of code
Could not resolve type: MobileService.GetTable<global::TestAzure.Person
2. //This is the exception message returned from a try/catch I added around the code.
"The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."