Browse Source

Removed mutli-tenancy. Removed admin site from the main website.

pull/15/head
Halil İbrahim Kalkan 6 years ago
parent
commit
8f7344bd8e
  1. 2
      eventhub/src/EventHub.Application.Contracts/EventHub.Application.Contracts.csproj
  2. 4
      eventhub/src/EventHub.Application.Contracts/EventHubApplicationContractsModule.cs
  3. 2
      eventhub/src/EventHub.Application/EventHub.Application.csproj
  4. 6
      eventhub/src/EventHub.Application/EventHubApplicationModule.cs
  5. 2
      eventhub/src/EventHub.Domain.Shared/EventHub.Domain.Shared.csproj
  6. 6
      eventhub/src/EventHub.Domain.Shared/EventHubDomainSharedModule.cs
  7. 11
      eventhub/src/EventHub.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs
  8. 44
      eventhub/src/EventHub.Domain/Data/EventHubDbMigrationService.cs
  9. 2
      eventhub/src/EventHub.Domain/EventHub.Domain.csproj
  10. 11
      eventhub/src/EventHub.Domain/EventHubDomainModule.cs
  11. 9
      eventhub/src/EventHub.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/EventHubMigrationsDbContext.cs
  12. 2185
      eventhub/src/EventHub.EntityFrameworkCore.DbMigrations/Migrations/20210116170949_Removed_MultiTenancy.Designer.cs
  13. 88
      eventhub/src/EventHub.EntityFrameworkCore.DbMigrations/Migrations/20210116170949_Removed_MultiTenancy.cs
  14. 122
      eventhub/src/EventHub.EntityFrameworkCore.DbMigrations/Migrations/EventHubMigrationsDbContextModelSnapshot.cs
  15. 6
      eventhub/src/EventHub.EntityFrameworkCore/EntityFrameworkCore/EventHubEntityFrameworkCoreModule.cs
  16. 2
      eventhub/src/EventHub.EntityFrameworkCore/EventHub.EntityFrameworkCore.csproj
  17. 6
      eventhub/src/EventHub.HttpApi.Client/EventHubHttpApiClientModule.cs
  18. 2
      eventhub/src/EventHub.HttpApi.Host/EventHub.HttpApi.Host.csproj
  19. 15
      eventhub/src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs
  20. 2
      eventhub/src/EventHub.HttpApi/EventHub.HttpApi.csproj
  21. 6
      eventhub/src/EventHub.HttpApi/EventHubHttpApiModule.cs
  22. 10
      eventhub/src/EventHub.IdentityServer/EventHubIdentityServerModule.cs
  23. 1
      eventhub/src/EventHub.Web.Admin/EventHub.Web.Admin.csproj
  24. 4
      eventhub/src/EventHub.Web.Admin/EventHubBlazorModule.cs
  25. 4
      eventhub/src/EventHub.Web/EventHub.Web.csproj
  26. 30
      eventhub/src/EventHub.Web/EventHubWebModule.cs
  27. 9
      eventhub/src/EventHub.Web/Menus/EventHubMenuContributor.cs

2
eventhub/src/EventHub.Application.Contracts/EventHub.Application.Contracts.csproj

@ -16,8 +16,6 @@
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.TenantManagement.Application.Contracts" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="4.2.0-rc.1" />
</ItemGroup>
</Project>

4
eventhub/src/EventHub.Application.Contracts/EventHubApplicationContractsModule.cs

@ -1,20 +1,16 @@
using Volo.Abp.Account;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
using Volo.Abp.Modularity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.PermissionManagement;
using Volo.Abp.TenantManagement;
namespace EventHub
{
[DependsOn(
typeof(EventHubDomainSharedModule),
typeof(AbpAccountApplicationContractsModule),
typeof(AbpFeatureManagementApplicationContractsModule),
typeof(AbpIdentityApplicationContractsModule),
typeof(AbpPermissionManagementApplicationContractsModule),
typeof(AbpTenantManagementApplicationContractsModule),
typeof(AbpObjectExtendingModule)
)]
public class EventHubApplicationContractsModule : AbpModule

2
eventhub/src/EventHub.Application/EventHub.Application.csproj

@ -16,8 +16,6 @@
<PackageReference Include="Volo.Abp.Account.Application" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.TenantManagement.Application" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" Version="4.2.0-rc.1" />
</ItemGroup>
</Project>

6
eventhub/src/EventHub.Application/EventHubApplicationModule.cs

@ -1,10 +1,8 @@
using Volo.Abp.Account;
using Volo.Abp.AutoMapper;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement;
using Volo.Abp.TenantManagement;
namespace EventHub
{
@ -13,9 +11,7 @@ namespace EventHub
typeof(AbpAccountApplicationModule),
typeof(EventHubApplicationContractsModule),
typeof(AbpIdentityApplicationModule),
typeof(AbpPermissionManagementApplicationModule),
typeof(AbpTenantManagementApplicationModule),
typeof(AbpFeatureManagementApplicationModule)
typeof(AbpPermissionManagementApplicationModule)
)]
public class EventHubApplicationModule : AbpModule
{

2
eventhub/src/EventHub.Domain.Shared/EventHub.Domain.Shared.csproj

@ -13,8 +13,6 @@
<PackageReference Include="Volo.Abp.IdentityServer.Domain.Shared" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain.Shared" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain.Shared" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain.Shared" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Shared" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="4.2.0-rc.1" />
</ItemGroup>

6
eventhub/src/EventHub.Domain.Shared/EventHubDomainSharedModule.cs

@ -1,7 +1,6 @@
using EventHub.Localization;
using Volo.Abp.AuditLogging;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
using Volo.Abp.IdentityServer;
using Volo.Abp.Localization;
@ -9,7 +8,6 @@ using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement;
using Volo.Abp.SettingManagement;
using Volo.Abp.TenantManagement;
using Volo.Abp.Validation.Localization;
using Volo.Abp.VirtualFileSystem;
@ -18,12 +16,10 @@ namespace EventHub
[DependsOn(
typeof(AbpAuditLoggingDomainSharedModule),
typeof(AbpBackgroundJobsDomainSharedModule),
typeof(AbpFeatureManagementDomainSharedModule),
typeof(AbpIdentityDomainSharedModule),
typeof(AbpIdentityServerDomainSharedModule),
typeof(AbpPermissionManagementDomainSharedModule),
typeof(AbpSettingManagementDomainSharedModule),
typeof(AbpTenantManagementDomainSharedModule)
typeof(AbpSettingManagementDomainSharedModule)
)]
public class EventHubDomainSharedModule : AbpModule
{

11
eventhub/src/EventHub.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs

@ -1,11 +0,0 @@
namespace EventHub.MultiTenancy
{
public static class MultiTenancyConsts
{
/* Enable/disable multi-tenancy easily in a single point.
* If you will never need to multi-tenancy, you can remove
* related modules and code parts, including this file.
*/
public const bool IsEnabled = true;
}
}

44
eventhub/src/EventHub.Domain/Data/EventHubDbMigrationService.cs

@ -10,7 +10,6 @@ using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
using Volo.Abp.TenantManagement;
namespace EventHub.Data
{
@ -20,18 +19,15 @@ namespace EventHub.Data
private readonly IDataSeeder _dataSeeder;
private readonly IEnumerable<IEventHubDbSchemaMigrator> _dbSchemaMigrators;
private readonly ITenantRepository _tenantRepository;
private readonly ICurrentTenant _currentTenant;
public EventHubDbMigrationService(
IDataSeeder dataSeeder,
IEnumerable<IEventHubDbSchemaMigrator> dbSchemaMigrators,
ITenantRepository tenantRepository,
ICurrentTenant currentTenant)
{
_dataSeeder = dataSeeder;
_dbSchemaMigrators = dbSchemaMigrators;
_tenantRepository = tenantRepository;
_currentTenant = currentTenant;
Logger = NullLogger<EventHubDbMigrationService>.Instance;
@ -58,42 +54,12 @@ namespace EventHub.Data
await SeedDataAsync();
Logger.LogInformation($"Successfully completed host database migrations.");
var tenants = await _tenantRepository.GetListAsync(includeDetails: true);
var migratedDatabaseSchemas = new HashSet<string>();
foreach (var tenant in tenants)
{
using (_currentTenant.Change(tenant.Id))
{
if (tenant.ConnectionStrings.Any())
{
var tenantConnectionStrings = tenant.ConnectionStrings
.Select(x => x.Value)
.ToList();
if (!migratedDatabaseSchemas.IsSupersetOf(tenantConnectionStrings))
{
await MigrateDatabaseSchemaAsync(tenant);
migratedDatabaseSchemas.AddIfNotContains(tenantConnectionStrings);
}
}
await SeedDataAsync(tenant);
}
Logger.LogInformation($"Successfully completed {tenant.Name} tenant database migrations.");
}
Logger.LogInformation("Successfully completed all database migrations.");
Logger.LogInformation("You can safely end this process...");
}
private async Task MigrateDatabaseSchemaAsync(Tenant tenant = null)
private async Task MigrateDatabaseSchemaAsync()
{
Logger.LogInformation(
$"Migrating schema for {(tenant == null ? "host" : tenant.Name + " tenant")} database...");
Logger.LogInformation($"Migrating database schema...");
foreach (var migrator in _dbSchemaMigrators)
{
@ -101,11 +67,11 @@ namespace EventHub.Data
}
}
private async Task SeedDataAsync(Tenant tenant = null)
private async Task SeedDataAsync()
{
Logger.LogInformation($"Executing {(tenant == null ? "host" : tenant.Name + " tenant")} database seed...");
Logger.LogInformation($"Executing database seed...");
await _dataSeeder.SeedAsync(tenant?.Id);
await _dataSeeder.SeedAsync();
}
private async Task<bool> MigrationsFolderExists()

2
eventhub/src/EventHub.Domain/EventHub.Domain.csproj

@ -19,8 +19,6 @@
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.IdentityServer" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain" Version="4.2.0-rc.1" />
</ItemGroup>

11
eventhub/src/EventHub.Domain/EventHubDomainModule.cs

@ -1,18 +1,14 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using EventHub.MultiTenancy;
using Volo.Abp.AuditLogging;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.Emailing;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
using Volo.Abp.IdentityServer;
using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement.Identity;
using Volo.Abp.PermissionManagement.IdentityServer;
using Volo.Abp.SettingManagement;
using Volo.Abp.TenantManagement;
namespace EventHub
{
@ -20,24 +16,17 @@ namespace EventHub
typeof(EventHubDomainSharedModule),
typeof(AbpAuditLoggingDomainModule),
typeof(AbpBackgroundJobsDomainModule),
typeof(AbpFeatureManagementDomainModule),
typeof(AbpIdentityDomainModule),
typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpIdentityServerDomainModule),
typeof(AbpPermissionManagementDomainIdentityServerModule),
typeof(AbpSettingManagementDomainModule),
typeof(AbpTenantManagementDomainModule),
typeof(AbpEmailingModule)
)]
public class EventHubDomainModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpMultiTenancyOptions>(options =>
{
options.IsEnabled = MultiTenancyConsts.IsEnabled;
});
#if DEBUG
context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>());
#endif

9
eventhub/src/EventHub.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/EventHubMigrationsDbContext.cs

@ -2,13 +2,10 @@
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Identity;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.IdentityServer.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.TenantManagement.EntityFrameworkCore;
namespace EventHub.EntityFrameworkCore
{
@ -19,7 +16,7 @@ namespace EventHub.EntityFrameworkCore
*/
public class EventHubMigrationsDbContext : AbpDbContext<EventHubMigrationsDbContext>
{
public EventHubMigrationsDbContext(DbContextOptions<EventHubMigrationsDbContext> options)
public EventHubMigrationsDbContext(DbContextOptions<EventHubMigrationsDbContext> options)
: base(options)
{
@ -37,12 +34,10 @@ namespace EventHub.EntityFrameworkCore
builder.ConfigureAuditLogging();
builder.ConfigureIdentity();
builder.ConfigureIdentityServer();
builder.ConfigureFeatureManagement();
builder.ConfigureTenantManagement();
/* Configure your own tables/entities inside the ConfigureEventHub method */
builder.ConfigureEventHub();
}
}
}
}

2185
eventhub/src/EventHub.EntityFrameworkCore.DbMigrations/Migrations/20210116170949_Removed_MultiTenancy.Designer.cs

File diff suppressed because it is too large

88
eventhub/src/EventHub.EntityFrameworkCore.DbMigrations/Migrations/20210116170949_Removed_MultiTenancy.cs

@ -0,0 +1,88 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace EventHub.Migrations
{
public partial class Removed_MultiTenancy : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpFeatureValues");
migrationBuilder.DropTable(
name: "AbpTenantConnectionStrings");
migrationBuilder.DropTable(
name: "AbpTenants");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpFeatureValues",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
ProviderKey = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProviderName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
Value = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpFeatureValues", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpTenants",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpTenants", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpTenantConnectionStrings",
columns: table => new
{
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Value = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpTenantConnectionStrings", x => new { x.TenantId, x.Name });
table.ForeignKey(
name: "FK_AbpTenantConnectionStrings_AbpTenants_TenantId",
column: x => x.TenantId,
principalTable: "AbpTenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey",
table: "AbpFeatureValues",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpTenants_Name",
table: "AbpTenants",
column: "Name");
}
}
}

122
eventhub/src/EventHub.EntityFrameworkCore.DbMigrations/Migrations/EventHubMigrationsDbContextModelSnapshot.cs

@ -331,37 +331,6 @@ namespace EventHub.Migrations
b.ToTable("AbpBackgroundJobs");
});
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("ProviderName")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpFeatureValues");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property<Guid>("Id")
@ -1860,83 +1829,6 @@ namespace EventHub.Migrations
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("AbpTenants");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b =>
{
b.Property<Guid>("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("nvarchar(1024)");
b.HasKey("TenantId", "Name");
b.ToTable("AbpTenantConnectionStrings");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null)
@ -2205,15 +2097,6 @@ namespace EventHub.Migrations
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b =>
{
b.HasOne("Volo.Abp.TenantManagement.Tenant", null)
.WithMany("ConnectionStrings")
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Navigation("Actions");
@ -2294,11 +2177,6 @@ namespace EventHub.Migrations
b.Navigation("UserClaims");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b =>
{
b.Navigation("ConnectionStrings");
});
#pragma warning restore 612, 618
}
}

6
eventhub/src/EventHub.EntityFrameworkCore/EntityFrameworkCore/EventHubEntityFrameworkCoreModule.cs

@ -3,13 +3,11 @@ using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.SqlServer;
using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.IdentityServer.EntityFrameworkCore;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.TenantManagement.EntityFrameworkCore;
namespace EventHub.EntityFrameworkCore
{
@ -21,9 +19,7 @@ namespace EventHub.EntityFrameworkCore
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpBackgroundJobsEntityFrameworkCoreModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule),
typeof(AbpTenantManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule)
typeof(AbpAuditLoggingEntityFrameworkCoreModule)
)]
public class EventHubEntityFrameworkCoreModule : AbpModule
{

2
eventhub/src/EventHub.EntityFrameworkCore/EventHub.EntityFrameworkCore.csproj

@ -16,8 +16,6 @@
<PackageReference Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.BackgroundJobs.EntityFrameworkCore" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" Version="4.2.0-rc.1" />
</ItemGroup>
</Project>

6
eventhub/src/EventHub.HttpApi.Client/EventHubHttpApiClientModule.cs

@ -1,10 +1,8 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Account;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement;
using Volo.Abp.TenantManagement;
namespace EventHub
{
@ -12,9 +10,7 @@ namespace EventHub
typeof(EventHubApplicationContractsModule),
typeof(AbpAccountHttpApiClientModule),
typeof(AbpIdentityHttpApiClientModule),
typeof(AbpPermissionManagementHttpApiClientModule),
typeof(AbpTenantManagementHttpApiClientModule),
typeof(AbpFeatureManagementHttpApiClientModule)
typeof(AbpPermissionManagementHttpApiClientModule)
)]
public class EventHubHttpApiClientModule : AbpModule
{

2
eventhub/src/EventHub.HttpApi.Host/EventHub.HttpApi.Host.csproj

@ -15,11 +15,11 @@
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.*" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="5.0.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.*" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.Autofac" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.Swashbuckle" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="4.2.0-rc.1" />
</ItemGroup>
<ItemGroup>

15
eventhub/src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs

@ -11,12 +11,11 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using EventHub.EntityFrameworkCore;
using EventHub.MultiTenancy;
using StackExchange.Redis;
using Microsoft.OpenApi.Models;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac;
@ -33,11 +32,11 @@ namespace EventHub
typeof(EventHubHttpApiModule),
typeof(AbpAutofacModule),
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
typeof(EventHubApplicationModule),
typeof(EventHubEntityFrameworkCoreDbMigrationsModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule)
typeof(AbpSwashbuckleModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule)
)]
public class EventHubHttpApiHostModule : AbpModule
{
@ -199,14 +198,7 @@ namespace EventHub
app.UseRouting();
app.UseCors(DefaultCorsPolicyName);
app.UseAuthentication();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}
app.UseAuthorization();
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
{
@ -216,7 +208,6 @@ namespace EventHub
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
});
app.UseAuditing();
app.UseAbpSerilogEnrichers();
app.UseUnitOfWork();

2
eventhub/src/EventHub.HttpApi/EventHub.HttpApi.csproj

@ -15,8 +15,6 @@
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.HttpApi" Version="4.2.0-rc.1" />
</ItemGroup>
</Project>

6
eventhub/src/EventHub.HttpApi/EventHubHttpApiModule.cs

@ -1,12 +1,10 @@
using Localization.Resources.AbpUi;
using EventHub.Localization;
using Volo.Abp.Account;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.HttpApi;
using Volo.Abp.TenantManagement;
namespace EventHub
{
@ -14,9 +12,7 @@ namespace EventHub
typeof(EventHubApplicationContractsModule),
typeof(AbpAccountHttpApiModule),
typeof(AbpIdentityHttpApiModule),
typeof(AbpPermissionManagementHttpApiModule),
typeof(AbpTenantManagementHttpApiModule),
typeof(AbpFeatureManagementHttpApiModule)
typeof(AbpPermissionManagementHttpApiModule)
)]
public class EventHubHttpApiModule : AbpModule
{

10
eventhub/src/EventHub.IdentityServer/EventHubIdentityServerModule.cs

@ -9,13 +9,10 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using EventHub.EntityFrameworkCore;
using EventHub.Localization;
using EventHub.MultiTenancy;
using StackExchange.Redis;
using Volo.Abp;
using Volo.Abp.Account;
using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Mvc.UI;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
@ -29,7 +26,6 @@ using Volo.Abp.Caching.StackExchangeRedis;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation.Urls;
using Volo.Abp.UI;
using Volo.Abp.VirtualFileSystem;
namespace EventHub
@ -167,12 +163,6 @@ namespace EventHub
app.UseRouting();
app.UseCors(DefaultCorsPolicyName);
app.UseAuthentication();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}
app.UseUnitOfWork();
app.UseIdentityServer();
app.UseAuthorization();

1
eventhub/src/EventHub.Web.Admin/EventHub.Web.Admin.csproj

@ -20,7 +20,6 @@
<ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Blazor" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.TenantManagement.Blazor" Version="4.2.0-rc.1" />
</ItemGroup>
<ItemGroup>

4
eventhub/src/EventHub.Web.Admin/EventHubBlazorModule.cs

@ -14,7 +14,6 @@ using Volo.Abp.Autofac.WebAssembly;
using Volo.Abp.AutoMapper;
using Volo.Abp.Identity.Blazor;
using Volo.Abp.Modularity;
using Volo.Abp.TenantManagement.Blazor;
using Volo.Abp.UI.Navigation;
namespace EventHub.Web.Admin
@ -23,8 +22,7 @@ namespace EventHub.Web.Admin
typeof(AbpAutofacWebAssemblyModule),
typeof(EventHubHttpApiClientModule),
typeof(AbpAspNetCoreComponentsWebAssemblyBasicThemeModule),
typeof(AbpIdentityBlazorModule),
typeof(AbpTenantManagementBlazorModule)
typeof(AbpIdentityBlazorModule)
)]
public class EventHubBlazorModule : AbpModule
{

4
eventhub/src/EventHub.Web/EventHub.Web.csproj

@ -22,6 +22,7 @@
<ItemGroup>
<PackageReference Include="Volo.Abp.Autofac" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.Client" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.OpenIdConnect" Version="4.2.0-rc.1" />
@ -30,9 +31,6 @@
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel.Web" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.Swashbuckle" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.Identity.Web" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.TenantManagement.Web" Version="4.2.0-rc.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.Web" Version="4.2.0-rc.1" />
<ProjectReference Include="..\EventHub.HttpApi\EventHub.HttpApi.csproj" />
<ProjectReference Include="..\EventHub.HttpApi.Client\EventHub.HttpApi.Client.csproj" />
</ItemGroup>

30
eventhub/src/EventHub.Web/EventHubWebModule.cs

@ -8,7 +8,6 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.IdentityModel.Protocols.OpenIdConnect;
using EventHub.Localization;
using EventHub.MultiTenancy;
using EventHub.Web.Menus;
using StackExchange.Redis;
using Microsoft.OpenApi.Models;
@ -16,8 +15,6 @@ using Volo.Abp;
using Volo.Abp.AspNetCore.Authentication.OpenIdConnect;
using Volo.Abp.AspNetCore.Mvc.Client;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
@ -28,16 +25,10 @@ using Volo.Abp.Autofac;
using Volo.Abp.AutoMapper;
using Volo.Abp.Caching;
using Volo.Abp.Caching.StackExchangeRedis;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Http.Client.IdentityModel.Web;
using Volo.Abp.Identity.Web;
using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement.Web;
using Volo.Abp.Swashbuckle;
using Volo.Abp.TenantManagement.Web;
using Volo.Abp.UI.Navigation.Urls;
using Volo.Abp.UI;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem;
@ -50,11 +41,9 @@ namespace EventHub.Web
typeof(AbpAspNetCoreMvcClientModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAutofacModule),
typeof(AbpAutoMapperModule),
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpFeatureManagementWebModule),
typeof(AbpHttpClientIdentityModelWebModule),
typeof(AbpIdentityWebModule),
typeof(AbpTenantManagementWebModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule)
)]
@ -86,7 +75,6 @@ namespace EventHub.Web
ConfigureAutoMapper();
ConfigureVirtualFileSystem(hostingEnvironment);
ConfigureNavigationServices(configuration);
ConfigureMultiTenancy();
ConfigureSwaggerServices(context.Services);
}
@ -120,14 +108,6 @@ namespace EventHub.Web
});
}
private void ConfigureMultiTenancy()
{
Configure<AbpMultiTenancyOptions>(options =>
{
options.IsEnabled = MultiTenancyConsts.IsEnabled;
});
}
private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)
{
context.Services.AddAuthentication(options =>
@ -239,20 +219,12 @@ namespace EventHub.Web
app.UseVirtualFiles();
app.UseRouting();
app.UseAuthentication();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}
app.UseAuthorization();
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "EventHub API");
});
app.UseAuditing();
app.UseAbpSerilogEnrichers();
app.UseConfiguredEndpoints();

9
eventhub/src/EventHub.Web/Menus/EventHubMenuContributor.cs

@ -2,11 +2,8 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using EventHub.Localization;
using EventHub.MultiTenancy;
using Volo.Abp.Account.Localization;
using Volo.Abp.TenantManagement.Web.Navigation;
using Volo.Abp.UI.Navigation;
using Volo.Abp.Users;
@ -35,12 +32,6 @@ namespace EventHub.Web.Menus
private Task ConfigureMainMenuAsync(MenuConfigurationContext context)
{
if (!MultiTenancyConsts.IsEnabled)
{
var administration = context.Menu.GetAdministration();
administration.TryRemoveMenuItem(TenantManagementMenuNames.GroupName);
}
var l = context.GetLocalizer<EventHubResource>();
context.Menu.Items.Insert(0, new ApplicationMenuItem(EventHubMenus.Home, l["Menu:Home"], "~/"));

Loading…
Cancel
Save