IwbZeroHostDbContext.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using System.Data.Common;
  2. using System.Data.Entity;
  3. using System.Data.Entity.Core.Objects;
  4. using System.Data.Entity.Infrastructure;
  5. using Abp.MultiTenancy;
  6. using IwbZero.Authorization.Base.Users;
  7. using IwbZero.Authorization.Roles;
  8. using IwbZero.Authorization.Users;
  9. using IwbZero.MultiTenancy;
  10. namespace IwbZero.EntityFramework
  11. {
  12. [MultiTenancySide(MultiTenancySides.Host)]
  13. public abstract class IwbZeroHostDbContext<TTenant, TRole, TUser> : IwbZeroCommonDbContext<TRole, TUser>
  14. where TTenant : IwbTenant<TUser>
  15. where TRole : IwbSysRole<TUser>
  16. where TUser : IwbSysUser<TUser>
  17. {
  18. /// <summary>
  19. /// Tenants
  20. /// </summary>
  21. public virtual IDbSet<TTenant> Tenants { get; set; }
  22. ///// <summary>
  23. ///// Editions.
  24. ///// </summary>
  25. //public virtual IDbSet<Edition> Editions { get; set; }
  26. ///// <summary>
  27. ///// FeatureSettings.
  28. ///// </summary>
  29. //public virtual IDbSet<FeatureSetting> FeatureSettings { get; set; }
  30. ///// <summary>
  31. ///// TenantFeatureSetting.
  32. ///// </summary>
  33. //public virtual IDbSet<TenantFeatureSetting> TenantFeatureSettings { get; set; }
  34. ///// <summary>
  35. ///// EditionFeatureSettings.
  36. ///// </summary>
  37. //public virtual IDbSet<EditionFeatureSetting> EditionFeatureSettings { get; set; }
  38. ///// <summary>
  39. ///// Background jobs.
  40. ///// </summary>
  41. //public virtual IDbSet<BackgroundJobInfo> BackgroundJobs { get; set; }
  42. /// <summary>
  43. /// User accounts
  44. /// </summary>
  45. public virtual IDbSet<UserAccount> UserAccounts { get; set; }
  46. protected IwbZeroHostDbContext()
  47. {
  48. }
  49. protected IwbZeroHostDbContext(string nameOrConnectionString)
  50. : base(nameOrConnectionString)
  51. {
  52. }
  53. protected IwbZeroHostDbContext(DbCompiledModel model)
  54. : base(model)
  55. {
  56. }
  57. protected IwbZeroHostDbContext(DbConnection existingConnection, bool contextOwnsConnection)
  58. : base(existingConnection, contextOwnsConnection)
  59. {
  60. }
  61. protected IwbZeroHostDbContext(string nameOrConnectionString, DbCompiledModel model)
  62. : base(nameOrConnectionString, model)
  63. {
  64. }
  65. protected IwbZeroHostDbContext(ObjectContext objectContext, bool dbContextOwnsObjectContext)
  66. : base(objectContext, dbContextOwnsObjectContext)
  67. {
  68. }
  69. protected IwbZeroHostDbContext(DbConnection existingConnection, DbCompiledModel model, bool contextOwnsConnection)
  70. : base(existingConnection, model, contextOwnsConnection)
  71. {
  72. }
  73. }
  74. }