EFCore - Seed data only if it doesn't exist in another table
问题 I want to seed some data using EntityFramework in .net core 3.1 and I'm facing an issue: I've got two SQL tables (so two DbSet<>): public virtual DbSet<TableA> TableA { get; set; } public virtual DbSet<TableB> TableB { get; set; } Table A has this structure: [Key] public int Id { get; set; } // PK public string EnglishText { get; set; } // some value Table B has this structure: [Key] public int Id { get; set; } // PK public int TableAId { get; set; } // FK to Table A public string