diff --git "a/\350\214\203\351\270\277\351\233\257/20250103-\347\247\215\345\255\220\346\225\260\346\215\256.md" "b/\350\214\203\351\270\277\351\233\257/20250103-\347\247\215\345\255\220\346\225\260\346\215\256.md" new file mode 100644 index 0000000000000000000000000000000000000000..53bb48b6bb355eaa766012065fe5fba578c11f34 --- /dev/null +++ "b/\350\214\203\351\270\277\351\233\257/20250103-\347\247\215\345\255\220\346\225\260\346\215\256.md" @@ -0,0 +1,14 @@ +## 种子数据 +```c# +public class AppDbContext : DbContext{ +public AppDbContext(DbContextOptions options) :base(options){} +protected override void OnModelCreating(ModelBuilder modelBuilder){ + modelBuilder.Entity().HasData( + new Idol{Id=1,Name="JinMin"}, + new Idol{Id=2,Name="JiSung"} + ) +} +} + + +``` \ No newline at end of file