该库的作用是为了在开发过程中,快速生成测试数据。
Package | Version | Downloads |
---|---|---|
Snakeskin | ||
Snakeskin.EntityFrameworkCore |
public class SnakeskinDbContext(DbContextOptions<SnakeskinDbContext> options) : DbContext(options)
{
public DbSet<User> Users { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Fake<User>()
.WithCount(10_000);
modelBuilder.CommitFake();
base.OnModelCreating(modelBuilder);
}
}