Reputation: 3437
I have an Azure Mobile Service Project (.Net backend) and an ASP.Net MVC 5 project in the same Visual Studio solution. If I add a model class to the Azure Service project say Customer.cs extending EntityData. How can I have CRUD access to this object from ASP.Net MVC.
Here is what I did currently and I am looking for ways to make it better
Add a DTO to the MVC with almost identical fields to the Customer.cs in the Mobile Service project
Add an ADO.Net Entity Data Object that connects directly to the Azure SQL Database backing the Mobile Service
How can I achive the same result differently. The above steps works, but I am concerned about duplication. I ended up with 2 Web API projects?
In the Knockout script, I have this variable which maps to local project2/controllers/customer/get
var Uri = '/api/customers/';
How can I get it to point to the controller method in Project 1, can something like this work
var Uri = 'project1.azure-mobile.net/api/customers/';
Upvotes: 0
Views: 480
Reputation: 825
Why not use the Azure Mobile Service client SDK for Javascript? http://azure.microsoft.com/en-us/documentation/articles/mobile-services-html-how-to-use-client-library/
This will give you access to the tables and custom API in your JavaScript client. You can still use knockout to bind the data in your UI.
Upvotes: 1