title: Entity Framework and a Dynamics NAV database
body: <p>I'm currently working on an Intranet application project, using ASP.NET MVC 3.
  One of the primary requirements is that all data created with the application must be available in the clients' ERP software as well; they work with MS Dynamics NAV. Accessing the data is not really a problem, as NAV uses SQL-Server as its database.</p>
  
  <p>In fact I already have a working prototype, that uses Entity Framework for data access. The main issue here is that my company also develops quite a lot of custom functionality within the ERP, and thus some of the database tables I have to read from and write to often change. This would not really be a problem in a usual situation, but here, each and every field in the database is marked as <code>not null</code>, a very annoying feature of Dynamics NAV. That means that every field added to a table breaks my code, as Entity Framework tries to insert null when it doesn't know of a field.</p>
  
  <p>Can any of you think of a solution that would not require regenerating the model after each change in the tables ?</p>
  
  <p><strong>Edit :</strong> Unfortunately our client still uses version 4.0 of Nav, so webservices are not an option.. I have already developed another application for them (part of a Warehouse management system which runs on mobile terminals), accessing SQL Server directly, but it was not quite the same scale.</p>