Im using Xamarin Studio and Microsoft Azure to create an IOS App. I am trying to connect the table I created in the Microsoft Azure Mobile Services to my app and I am having some trouble.
I created a new mobile service and a new table called "UsersTable" in the Microsoft Azure Portal. I then went to my code and started to connect to the table. Here is what I have:
UsersService.cs:
using System.Collections.Generic;
using MonoTouch.Foundation;
using System.Threading.Tasks;
using MonoTouch.UIKit;
using System.Net.Http;
using Microsoft.WindowsAzure.MobileServices;
namespace Practice_IOS
{
public class UsersService
{
private MobileServiceClient client;
private IMobileServiceTable<UsersTable> usersTable;
public List<UsersTable> Person { get; private set;}
protected UsersService ()
{
CurrentPlatform.Init ();
Person = new List<UsersTable>();
client = new MobileServiceClient (UsersConstants.ApplicationURL, UsersConstants.ApplicationKey, this);
usersTable = client.GetTable<UsersTable>();
}
}
}
UsersTable.cs
using System;
using Newtonsoft.Json;
namespace Practice_IOS
{
public class UsersTable
{
public string Id { get; set; }
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }
[JsonProperty(PropertyName = "email")]
public bool Email { get; set; }
[JsonProperty(PropertyName = "password")]
public string Password { get; set; }
}
}
UsersConstants.cs:
using System;
namespace Practice_IOS
{
public static class UsersConstants
{
public const string ApplicationURL = @"https://practiceusersxamatin.azure-mobile.net/";
public const string ApplicationKey = @"SecretKeyGoesHere";
}
}
When I go to build it, it gets to the following line of code
client = new MobileServiceClient (UsersConstants.ApplicationURL, UsersConstants.ApplicationKey, this);
it tells me "Argument #3 cannot convert 'Practice.IOS.UsersService' expression to type System.Net.Http.HttpMessageHandler[]". How can I get this to be taken as an argument
I am using this tutorial http://azure.microsoft.com/en-us/documentation/articles/partner-xamarin-mobile-services-ios-get-started-data/ to help me try and connect.