I created a custom API using C#. The base project I donwloaded from Azure-Portal. When I publish the project with the new custom API I can see all the "todoItem" functions but not the custom API I created. How can I register this API?
Controller:
using System;
using System.Threading.Tasks;
using System.Web.Http;
using CustomeeMobileServiceService.DataObjects;
using CustomeeMobileServiceService.Models;
using Microsoft.WindowsAzure.Mobile.Service;
namespace CustomeeMobileServiceService.Controllers
{
public class MobileRegistrationController : ApiController
{
public ApiServices Services { get; set; }
// GET api/MobileRegistration
public string Get()
{
Services.Log.Info("Hello from custom controller!");
return "Hello";
}
[HttpGet]
public async Task<Guid> GetMobileRegistrationId()
{
using (var context = new CustomeeMobileServiceContext())
{
// Get the database from the context.
var db = context.Database;
var model = new MobileRegistration();
var mobileRegistrationId = new Guid();
var spParams = new object[] { mobileRegistrationId };
await db.ExecuteSqlCommandAsync("EXEC dbo.MobileRegistration.GetMobileRegistrationId", spParams);
return mobileRegistrationId;
}
}
}
}
DataObjects:
public class MobileRegistration : EntityData
{
public Guid MobileRegistrationId { get; set; }
}