diff --git "a/\345\274\240\344\277\212\346\235\260/20250105.md" "b/\345\274\240\344\277\212\346\235\260/20250105.md" new file mode 100644 index 0000000000000000000000000000000000000000..663a9bd64e87874bc1470beb66ad16985e8aa046 --- /dev/null +++ "b/\345\274\240\344\277\212\346\235\260/20250105.md" @@ -0,0 +1,13 @@ +## 种子数据 +```html +public class AppDbContext : DbContext{ +public AppDbContext(DbContextOptions options) :base(options){} +protected override void OnModelCreating(ModelBuilder modelBuilder){ + modelBuilder.Entity().HasData( + new Idol{Id=1,Name="bk"}, + new Idol{Id=2,Name="pp"} + ) +} +} + +``` \ No newline at end of file