| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- using System.Data.Common;
- using System.Data.Entity.Core.Objects;
- using System.Data.Entity.Infrastructure;
- using Abp.MultiTenancy;
- using IwbZero.Authorization.Roles;
- using IwbZero.Authorization.Users;
- namespace IwbZero.EntityFramework
- {
- [MultiTenancySide(MultiTenancySides.Tenant)]
- public abstract class IwbZeroTenantDbContext<TRole, TUser> : IwbZeroCommonDbContext<TRole, TUser>
- where TRole : IwbSysRole<TUser>
- where TUser : IwbSysUser<TUser>
- {
- /// <summary>
- /// Default constructor.
- /// Do not directly instantiate this class. Instead, use dependency injection!
- /// </summary>
- protected IwbZeroTenantDbContext()
- {
- }
- /// <summary>
- /// Constructor with connection string parameter.
- /// </summary>
- /// <param name="nameOrConnectionString">Connection string or a name in connection strings in configuration file</param>
- protected IwbZeroTenantDbContext(string nameOrConnectionString)
- : base(nameOrConnectionString)
- {
- }
- protected IwbZeroTenantDbContext(DbCompiledModel model)
- : base(model)
- {
- }
- /// <summary>
- /// This constructor can be used for unit tests.
- /// </summary>
- protected IwbZeroTenantDbContext(DbConnection existingConnection, bool contextOwnsConnection)
- : base(existingConnection, contextOwnsConnection)
- {
- }
- protected IwbZeroTenantDbContext(string nameOrConnectionString, DbCompiledModel model)
- : base(nameOrConnectionString, model)
- {
- }
- protected IwbZeroTenantDbContext(ObjectContext objectContext, bool dbContextOwnsObjectContext)
- : base(objectContext, dbContextOwnsObjectContext)
- {
- }
- protected IwbZeroTenantDbContext(DbConnection existingConnection, DbCompiledModel model, bool contextOwnsConnection)
- : base(existingConnection, model, contextOwnsConnection)
- {
- }
- }
- }
|