InitialHostDbBuilder.cs 502 B

12345678910111213141516171819202122
  1. using VberAdmin.EntityFrameworkCore;
  2. namespace VberAdmin.Seed;
  3. public class InitialHostDbBuilder
  4. {
  5. private readonly VberAdminDbContext _context;
  6. public InitialHostDbBuilder(VberAdminDbContext context)
  7. {
  8. _context = context;
  9. }
  10. public void Create()
  11. {
  12. new DefaultSettingAndStateCreator(_context).Create();
  13. new DefaultFunctionCreator(_context).Create();
  14. new DefaultRoleAndUserCreator(_context).Create();
  15. _context.SaveChanges();
  16. }
  17. }