Reputation: 1916
I've started an ASP.NET Web App project using the template for an Azure Mobile Service and tried to create my model the Model-First approach.
After generating my database from my finished model I proceeded to add a TableController class for one of my entities to test my project.
But when I tried to make a POST request I got this message:
Model compatibility cannot be checked because the DbContext instance
was not created using Code First patterns. DbContext instances created
from an ObjectContext or using an EDMX file cannot be checked for
compatibility.","exceptionType":"System.NotSupportedException
Is it not possible to create an Azure Mobile Service with Model-First at all? What are my options if I want to use the Model-First approach?
Upvotes: 1
Views: 878
Reputation: 3875
If it's not an existing model, I would switch to Code First. It is possible to use Model First, but it requires more manual configuration.
If you have an existing model, see this tutorial on how to add the right system properties and map to data transfer objects: http://azure.microsoft.com/en-us/documentation/articles/mobile-services-dotnet-backend-use-existing-sql-database/
Upvotes: 1