c# - Add-Migration won't detect changes to foreign key -


The EF migration model can not seem to detect my changes because it only generates an empty () / Microsoft File: Migration File

__Migration History Table : __Migration History

Earlier
  public square house {public virtual icon A & lt; Person & gt; Used {received; Set; }} Public class car {// ...} public category {public int? Experiment id {receive; Set; } Using the Public Virtual House {get; Set; }}   

Mapping

  this.HasOptional (t = & gt; t.Using) .Very (T = & gt; T.UsedBy) .HasForeignKey (t = & gt; t.UsingId); Public square house {// deleted} after the public square car   

  added public virtual Ilkonak & lt; Person & gt; Used {received; Set; }} Public class person {public int? Experiment id {receives; Set; } // Using a converted public virtual car {get; Set; }}   

Mapping

  this.HasOptional (t = & gt; t.Using) .Very (T = & gt; t.UsedBy). HesForeignKey (t = & gt; t.UsingId); As already mentioned in my comment, I can reproduce it, but change the name of     

Property also has help - that the following code is not an option you can use to manually add the migration.
  public override zero () {DropForeignKey ("Dbo.People", "ID of experiment", "DBO.Home"); AddForeignKey ("dbo.People", "UsingId", "dbo.Cars", "ID"); } Public override-free (down) (drop-over ("debo. Peepal", "UIID", "DBO. Cars"); AddForeignKey ("dbo.People", "UsingId", "dbo.Houses", "ID"); }   

is based on whether the add-migration creates, when the name of the property changes.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -