1

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?

Uriel Arvizu
  • 1,876
  • 6
  • 37
  • 97

1 Answers1

1

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/

lindydonna
  • 3,874
  • 17
  • 26
  • So I should stick to Code First in this case, well I guess that's for the better, specially since Model First creates configuration code that some times brings more troubles than solutions. – Uriel Arvizu Jan 14 '15 at 19:25