In my team we C# developer do not have schema modification access to Database directly. There is a separate team which adds/alter tables for us. When a new requirement comes which needs a DB schema change they add the column/table and give us the details so we update our model class.
Following is the DataContext
public class FamilyDataContext : DbContext
{
public FamilyDataContext() : base("FamilyDataContext")
{
}
public DbSet<ResidentInformation> ResidentInformation { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
}
}
Problem: I am getting an error while trying to save data in this table.
The model backing the 'FamilyDataContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).
What I want is, if there is a mismatch in Model definition in C# code and Db schema, give an error so that it can be fixed manually either by dev or by DBA; rather than trying to upgrade the Database automatically. I do not want any automatic migration.
Is there anyway to achieve this please?