// AccountType und SubMarket aus DB laden, damit der Datensatz vom Context verfolgt wird und EF Core nicht versucht, diesen standardmäßig neu anzulegen.
MessageBox.Show($"Es wurden {importedCDsWithEFReferences.Count} eigene Beschreibungen erfolgreich der Datenbank hinzugefügt.{Environment.NewLine}Es wurden {thirdPartyProductsFromImportedCDs.Count} 3PP-Produkte neu angelegt.");
_ =MessageBox.Show($"Es wurden {importedCDsWithEFReferences.Count} eigene Beschreibungen erfolgreich der Datenbank hinzugefügt.{Environment.NewLine}Es wurden {thirdPartyProductsFromImportedCDs.Count} 3PP-Produkte neu angelegt.");
//.HasDefaultValue("Active") //Default-Wert wird nicht gesetzt?!? Bug in EF Core?
entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
_ =entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
//.IsRowVersion() impliziert .ValueGeneratedOnAddOrUpdate() und .IsConcurrencyToken(true)
entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
_ =entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
//.IsRequired(true) darf nicht gesetzt werden, da sonst vom DB-Engine NULL nicht erlaubt wird (trotz Definition als Bool? im Code. MySQL kennt kein Bool, sondern wandelt das intern in Tinyint um).
//.HasDefaultValue("Active") //Default-Wert wird nicht gesetzt?!? Bug in EF Core?
entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
_ =entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
//.IsRowVersion() impliziert .ValueGeneratedOnAddOrUpdate() und .IsConcurrencyToken(true)
entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
_ =entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
//.HasDefaultValue("Active") //Default-Wert wird nicht gesetzt?!? Bug in EF Core?
entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
_ =entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
//.IsRowVersion() impliziert .ValueGeneratedOnAddOrUpdate() und .IsConcurrencyToken(true)
entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
_ =entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
//.HasDefaultValue("Active") //Default-Wert wird nicht gesetzt?!? Bug in EF Core?
entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
_ =entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
//.IsRowVersion() impliziert .ValueGeneratedOnAddOrUpdate() und .IsConcurrencyToken(true)
entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
_ =entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
entity.HasOne(d=>d.CustomDescription).WithMany(p=>p.Products).HasForeignKey("CustomDescriptionId").IsRequired(false).OnDelete(DeleteBehavior.SetNull);//.IsRequired() is just fyi, because it is overwritten by FK property nullability (nullable = optional relationship, non-nullable = required relationship)!
_ =entity.HasOne(d=>d.CustomDescription).WithMany(p=>p.Products).HasForeignKey("CustomDescriptionId").IsRequired(false).OnDelete(DeleteBehavior.SetNull);//.IsRequired() is just fyi, because it is overwritten by FK property nullability (nullable = optional relationship, non-nullable = required relationship)!
//.HasDefaultValue("Active") //Default-Wert wird nicht gesetzt?!? Bug in EF Core?
entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
_ =entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
//.IsRowVersion() impliziert .ValueGeneratedOnAddOrUpdate() und .IsConcurrencyToken(true)
entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
_ =entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
//.HasDefaultValue("Active") //Default-Wert wird nicht gesetzt?!? Bug in EF Core?
entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
_ =entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
//.IsRowVersion() impliziert .ValueGeneratedOnAddOrUpdate() und .IsConcurrencyToken(true)
entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
_ =entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
//.HasDefaultValue("Active") //Default-Wert wird nicht gesetzt?!? Bug in EF Core?
entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
_ =entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
//.IsRowVersion() impliziert .ValueGeneratedOnAddOrUpdate() und .IsConcurrencyToken(true)
entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
_ =entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
//.HasDefaultValue("Active") //Default-Wert wird nicht gesetzt?!? Bug in EF Core?
entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
_ =entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
//.IsRowVersion() impliziert .ValueGeneratedOnAddOrUpdate() und .IsConcurrencyToken(true)
entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
_ =entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
//.HasDefaultValue("Active") //Default-Wert wird nicht gesetzt?!? Bug in EF Core?
entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
_ =entity.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
//.IsRowVersion() impliziert .ValueGeneratedOnAddOrUpdate() und .IsConcurrencyToken(true)
entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
_ =entity.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").IsRequired(true).HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
builder.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
builder.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
_ =builder.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
_ =builder.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
builder.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
builder.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
_ =builder.Property(e=>e.DataModificationDate).HasColumnType("TIMESTAMP").HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").ValueGeneratedOnAddOrUpdate().IsConcurrencyToken(true);
_ =builder.Property(e=>e.DataModificationByUser).HasColumnType("TINYTEXT").HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");
//check for detectedDataTypes = empty (possible when DataIdentificator.Identify(MustMatchAllQualifer = true) and no dataset matches all qualifiers of a type)
if(detectedDataTypes.Count==0)
{
MessageBox.Show($"DataIdentificator.Identify() konnte die Datenart nicht bestimmen!{Environment.NewLine}Versuchen Sie den Import mit einer dezidierten Importerfunktion.");
_ =MessageBox.Show($"DataIdentificator.Identify() konnte die Datenart nicht bestimmen!{Environment.NewLine}Versuchen Sie den Import mit einer dezidierten Importerfunktion.");
MessageBox.Show($"Es wurden {importedCDsWithEFReferences.Count} eigene Beschreibungen erfolgreich der Datenbank hinzugefügt.{Environment.NewLine}Es wurden {thirdPartyProductsFromImportedCDs.Count} 3PP-Produkte neu angelegt.");
_ =MessageBox.Show($"Es wurden {importedCDsWithEFReferences.Count} eigene Beschreibungen erfolgreich der Datenbank hinzugefügt.{Environment.NewLine}Es wurden {thirdPartyProductsFromImportedCDs.Count} 3PP-Produkte neu angelegt.");