BaseServiceDbContext.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using BaseService.BaseData;
  2. using BaseService.Systems;
  3. using Microsoft.EntityFrameworkCore;
  4. using Volo.Abp.Data;
  5. using Volo.Abp.EntityFrameworkCore;
  6. namespace BaseService.EntityFrameworkCore
  7. {
  8. [ConnectionStringName("Default")]
  9. public class BaseServiceDbContext : AbpDbContext<BaseServiceDbContext>
  10. {
  11. public DbSet<DataDictionary> DataDictionaries { get; set; }
  12. public DbSet<DataDictionaryDetail> DataDictionaryDetails { get; set; }
  13. public DbSet<Organization> Organizations { get; set; }
  14. public DbSet<Job> Jobs { get; set; }
  15. public DbSet<UserJob> UserJobs { get; set; }
  16. public DbSet<UserOrganization> UserOrganizations { get; set; }
  17. public DbSet<Menu> Menus { get; set; }
  18. public DbSet<RoleMenu> RoleMenus { get; set; }
  19. public BaseServiceDbContext(DbContextOptions<BaseServiceDbContext> options)
  20. : base(options)
  21. {
  22. }
  23. protected override void OnModelCreating(ModelBuilder builder)
  24. {
  25. base.OnModelCreating(builder);
  26. //builder.Entity<AppUser>(b =>
  27. //{
  28. // b.ToTable(AbpIdentityDbProperties.DbTablePrefix + "Users"); //Sharing the same table "AbpUsers" with the IdentityUser
  29. // b.ConfigureByConvention();
  30. // b.ConfigureAbpUser();
  31. // b.Property(x => x.Enable).HasDefaultValue(true);
  32. //});
  33. builder.ConfigureBaseService();
  34. }
  35. }
  36. }