EF MYSQL 在更新 有复合主键表时发生错误
public class trItemMap : EntityTypeConfiguration<SaleItemEntity>
{
public trItemMap()
{
this.ToTable("adm_tr_ltm_sls_rtn");
this.HasKey(t => t.TransactionID);
this.HasKey(t => t.SequenceNumber);
this.Property(t => t.TransactionID).HasColumnName("ID_TRN");
this.Property(t => t.SequenceNumber).HasColumnName("AI_LN_ITM");
this.Property(t => t.ProductNumber).HasColumnName("PRD_ID");
this.Property(t => t.ItemID).HasColumnName("ID_ITM");
this.Property(t => t.Price).HasColumnName("ITM_PRICE");
this.Property(t => t.videoheader).HasColumnName("VIDEO_HEADER");
this.Property(t => t.videofooter).HasColumnName("VIDEO_FOOTER");
this.Property(t => t.water_mark).HasColumnName("WATER_MARK");
this.Property(t => t.remark).HasColumnName("REMARK");
this.Property(t => t.UseYN).HasColumnName("USE_YN");
}
}
https://msdn.microsoft.com/en-us/library/jj591617(v=vs.113).aspx
modelBuilder.Entity<Department>().HasKey(t => new { t.DepartmentID, t.Name });
213123