47 changed files with 926 additions and 806 deletions
@ -0,0 +1,30 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>net8.0</TargetFramework> <!-- 或其他适合的框架 --> |
||||
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> |
||||
|
<PackageId>LINGYUN.Abp.MicroService.Templates</PackageId> |
||||
|
<Version>8.1.1</Version> |
||||
|
<Authors>colin.in@foxmail.com</Authors> |
||||
|
<Description>Abp framework micro-service template</Description> |
||||
|
<PackageLicenseExpression>MIT</PackageLicenseExpression> |
||||
|
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance> |
||||
|
<PackageProjectUrl>https://github.com/colinin/abp-next-admin</PackageProjectUrl> |
||||
|
<PackageTags>micro webapi cloud</PackageTags> |
||||
|
<PackageType>Template</PackageType> |
||||
|
<RepositoryType>git</RepositoryType> |
||||
|
<RepositoryUrl>https://github.com/colinin/abp-next-admin</RepositoryUrl> |
||||
|
<DevelopmentDependency>true</DevelopmentDependency> |
||||
|
<IsPackable>true</IsPackable> |
||||
|
<IsShipping>true</IsShipping> |
||||
|
<IsShippingPackage>true</IsShippingPackage> |
||||
|
<IncludeBuildOutput>False</IncludeBuildOutput> |
||||
|
<IncludeSource>False</IncludeSource> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<Content Include="content\**" Exclude="**/bin/**;**/obj/**;**/LocalNuget/**;**/.vs/**;**/.vscode/**;"> |
||||
|
<Pack>true</Pack> |
||||
|
<PackagePath>content</PackagePath> |
||||
|
</Content> |
||||
|
</ItemGroup> |
||||
|
</Project> |
||||
@ -1,48 +1,13 @@ |
|||||
<Project> |
<Project> |
||||
<PropertyGroup> |
<PropertyGroup> |
||||
<VoloAbpPackageVersion>8.0.3</VoloAbpPackageVersion> |
<IsTestProject Condition="$(MSBuildProjectFullPath.Contains('test')) and ($(MSBuildProjectName.EndsWith('.Tests')) or $(MSBuildProjectName.EndsWith('.TestBase')))">true</IsTestProject> |
||||
<VoloAbpLeptonXThemePackageVersion>3.0.0</VoloAbpLeptonXThemePackageVersion> |
</PropertyGroup> |
||||
<LINGYUNAbpPackageVersion>8.0.3</LINGYUNAbpPackageVersion> |
|
||||
<DaprPackageVersion>1.12.0</DaprPackageVersion> |
<ItemGroup> |
||||
<DistributedLockRedisPackageVersion>1.0.2</DistributedLockRedisPackageVersion> |
<PackageReference Condition="'$(IsTestProject)' == 'true'" Include="coverlet.collector"> |
||||
<DotNetCoreCAPPackageVersion>8.0.0</DotNetCoreCAPPackageVersion> |
<PrivateAssets>all</PrivateAssets> |
||||
<ElsaPackageVersion>2.11.0</ElsaPackageVersion> |
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> |
||||
<AliyunSDKPackageVersion>1.5.10</AliyunSDKPackageVersion> |
</PackageReference> |
||||
<AliyunOSSSDKPackageVersion>2.13.0</AliyunOSSSDKPackageVersion> |
</ItemGroup> |
||||
<TencentCloudSDKPackageVersion>3.0.712</TencentCloudSDKPackageVersion> |
|
||||
<AgileConfigClientPackageVersion>1.6.9</AgileConfigClientPackageVersion> |
</Project> |
||||
<HangfireMySqlStoragePackageVersion>2.0.3</HangfireMySqlStoragePackageVersion> |
|
||||
<HangfireMSSQLStoragePackageVersion>1.8.6</HangfireMSSQLStoragePackageVersion> |
|
||||
<NESTPackageVersion>7.15.1</NESTPackageVersion> |
|
||||
<NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion> |
|
||||
<OpenTelemetryExtensionsHostingPackageVersion>1.0.0-rc8</OpenTelemetryExtensionsHostingPackageVersion> |
|
||||
<OpenTelemetryExporterZipkinPackageVersion>1.3.1</OpenTelemetryExporterZipkinPackageVersion> |
|
||||
<OpenTelemetryInstrumentationAspNetCorePackageVersion>1.0.0-rc8</OpenTelemetryInstrumentationAspNetCorePackageVersion> |
|
||||
<OpenTelemetryInstrumentationHttpPackageVersion>1.0.0-rc8</OpenTelemetryInstrumentationHttpPackageVersion> |
|
||||
<OpenTelemetryContribInstrumentationEntityFrameworkCorePackageVersion>1.0.0-beta2</OpenTelemetryContribInstrumentationEntityFrameworkCorePackageVersion> |
|
||||
<QuartzNETPackageVersion>3.7.0</QuartzNETPackageVersion> |
|
||||
<StackExchangeRedisPackageVersion>2.7.4</StackExchangeRedisPackageVersion> |
|
||||
<SerilogPackageVersion>3.1.1</SerilogPackageVersion> |
|
||||
<SerilogAspNetCorePackageVersion>8.0.0</SerilogAspNetCorePackageVersion> |
|
||||
<SerilogEnrichersEnvironmentPackageVersion>2.3.0</SerilogEnrichersEnvironmentPackageVersion> |
|
||||
<SerilogEnrichersAssemblyPackageVersion>2.0.0</SerilogEnrichersAssemblyPackageVersion> |
|
||||
<SerilogEnrichersProcessPackageVersion>2.0.2</SerilogEnrichersProcessPackageVersion> |
|
||||
<SerilogEnrichersThreadPackageVersion>3.1.0</SerilogEnrichersThreadPackageVersion> |
|
||||
<SerilogExtensionsLoggingPackageVersion>8.0.0</SerilogExtensionsLoggingPackageVersion> |
|
||||
<SerilogSettingsConfigurationPackageVersion>8.0.0</SerilogSettingsConfigurationPackageVersion> |
|
||||
<SerilogSinksConsolePackageVersion>5.0.0</SerilogSinksConsolePackageVersion> |
|
||||
<SerilogSinksElasticsearchPackageVersion>9.0.3</SerilogSinksElasticsearchPackageVersion> |
|
||||
<SerilogSinksFilePackageVersion>5.0.0</SerilogSinksFilePackageVersion> |
|
||||
<SixLaborsImageSharpDrawingPackageVersion>2.0.1</SixLaborsImageSharpDrawingPackageVersion> |
|
||||
<SwashbuckleAspNetCorePackageVersion>6.5.0</SwashbuckleAspNetCorePackageVersion> |
|
||||
<PollyPackageVersion>8.2.0</PollyPackageVersion> |
|
||||
<MicrosoftPackageVersion>8.0.*</MicrosoftPackageVersion> |
|
||||
<MicrosoftEntityFrameworkCorePackageVersion>8.0.0</MicrosoftEntityFrameworkCorePackageVersion> |
|
||||
<XunitPackageVersion>2.6.1</XunitPackageVersion> |
|
||||
<XunitRunnerPackageVersion>2.5.5</XunitRunnerPackageVersion> |
|
||||
<ShouldlyPackageVersion>4.2.1</ShouldlyPackageVersion> |
|
||||
<NSubstitutePackageVersion>5.1.0</NSubstitutePackageVersion> |
|
||||
<MicrosoftNETTestSdkPackageVersion>17.8.0</MicrosoftNETTestSdkPackageVersion> |
|
||||
<CoverletCollectorPackageVersion>3.0.2</CoverletCollectorPackageVersion> |
|
||||
</PropertyGroup> |
|
||||
</Project> |
|
||||
|
|||||
@ -0,0 +1,293 @@ |
|||||
|
<Project> |
||||
|
<PropertyGroup> |
||||
|
<DotNetCoreCAPPackageVersion>8.1.1</DotNetCoreCAPPackageVersion> |
||||
|
<ElsaPackageVersion>2.14.1</ElsaPackageVersion> |
||||
|
<VoloAbpPackageVersion>8.1.1</VoloAbpPackageVersion> |
||||
|
<LINGYUNAbpPackageVersion>8.1.1</LINGYUNAbpPackageVersion> |
||||
|
<MicrosoftExtensionsPackageVersion>8.0.0</MicrosoftExtensionsPackageVersion> |
||||
|
<MicrosoftAspNetCorePackageVersion>8.0.0</MicrosoftAspNetCorePackageVersion> |
||||
|
<MicrosoftEntityFrameworkCorePackageVersion>8.0.0</MicrosoftEntityFrameworkCorePackageVersion> |
||||
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<!-- LINGYUN Abp Framework --> |
||||
|
<ItemGroup> |
||||
|
<PackageVersion Include="LINGYUN.Abp.AspNetCore.Mvc.Localization" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.AspNetCore.Mvc.Wrapper" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.AuditLogging.Elasticsearch" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.Data.DbMigrator" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.DataProtection" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.DataProtection.Abstractions" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.DataProtection.EntityFrameworkCore" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.DataProtectionManagement.Application" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.DataProtectionManagement.Application.Contracts" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.DataProtectionManagement.Domain" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.DataProtectionManagement.Domain.Shared" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.DataProtectionManagement.HttpApi" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.Dapr.Client" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.Dapr.Client.Wrapper" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.Dynamic.Queryable.Application" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.Dynamic.Queryable.Application.Contracts" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.Dynamic.Queryable.HttpApi" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.EventBus.CAP" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.ExceptionHandling.Emailing" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.Localization.CultureMap" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.Saas.EntityFrameworkCore" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.Serilog.Enrichers.Application" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.Serilog.Enrichers.UniqueId" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.SettingManagement.Application.Contracts" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="LINGYUN.Abp.TextTemplating.EntityFrameworkCore" Version="$(LINGYUNAbpPackageVersion)" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<!-- Abp Framework --> |
||||
|
<ItemGroup> |
||||
|
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="3.0.5" /> |
||||
|
<PackageVersion Include="Volo.Abp.Core" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Account.Application" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Account.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Account.Domain" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Account.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Account.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Account.HttpApi" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Account.Web.IdentityServer" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Account.Web.OpenIddict" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.AspNetCore" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.AspNetCore.MultiTenancy" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.Client.Common" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.Contracts" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.NewtonsoftJson" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.AspNetCore.Serilog" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.AspNetCore.SignalR" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.AspNetCore.TestBase" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Auditing" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Auditing.Contracts" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.AuditLogging.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Authorization" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Authorization.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Autofac" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.AutoMapper" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.BackgroundJobs" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.BackgroundJobs.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.BackgroundWorkers" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.BlobStoring" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.BlobStoring.FileSystem" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Caching" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Caching.StackExchangeRedis" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Cli.Core" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Data" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Ddd.Application" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Ddd.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Ddd.Domain" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Ddd.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.DistributedLocking.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.DistributedLocking" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.EntityFrameworkCore.MySql" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Features" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.FeatureManagement.Application" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.FeatureManagement.Domain" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.FeatureManagement.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.FeatureManagement.HttpApi" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Emailing" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.EventBus" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.EventBus.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.ExceptionHandling" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Guids" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.GlobalFeatures" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.HangFire" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Http.Client" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Http.Client.IdentityModel.Web" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Identity.AspNetCore" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Identity.Application" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Identity.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Identity.Domain" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Identity.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Identity.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Identity.HttpApi" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.IdentityServer.Application" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.IdentityServer.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.IdentityServer.Domain" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.IdentityServer.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.IdentityServer.HttpApi" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Identity.HttpApi.Client" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Imaging.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Imaging.ImageSharp" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Json" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Json.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Localization" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.MemoryDb" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.MultiTenancy" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.MultiTenancy.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.ObjectExtending" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.OpenIddict.Application" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.OpenIddict.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.OpenIddict.AspNetCore" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.OpenIddict.Domain" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.OpenIddict.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.OpenIddict.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.OpenIddict.HttpApi" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.PermissionManagement.Application" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.PermissionManagement.Domain" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.PermissionManagement.Domain.IdentityServer" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.PermissionManagement.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.PermissionManagement.HttpApi" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Quartz" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Security" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Settings" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.SettingManagement.Application" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.SettingManagement.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.SettingManagement.Domain" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.SettingManagement.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.SettingManagement.HttpApi" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Swashbuckle" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Sms" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.TestBase" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.TextTemplating.Core" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.TextTemplating.Scriban" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Timing" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Threading" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Users.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Users.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageVersion Include="Volo.Abp.Validation" Version="$(VoloAbpPackageVersion)" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<!-- .NET --> |
||||
|
<ItemGroup> |
||||
|
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(MicrosoftAspNetCorePackageVersion)" /> |
||||
|
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="$(MicrosoftAspNetCorePackageVersion)" /> |
||||
|
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="$(MicrosoftAspNetCorePackageVersion)" /> |
||||
|
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Protocols.Json" Version="$(MicrosoftAspNetCorePackageVersion)" /> |
||||
|
<PackageVersion Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="$(MicrosoftAspNetCorePackageVersion)" /> |
||||
|
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" /> |
||||
|
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" /> |
||||
|
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="$(MicrosoftEntityFrameworkCorePackageVersion)" /> |
||||
|
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="$(MicrosoftEntityFrameworkCorePackageVersion)" /> |
||||
|
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="$(MicrosoftExtensionsPackageVersion)" /> |
||||
|
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="$(MicrosoftExtensionsPackageVersion)" /> |
||||
|
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="$(MicrosoftExtensionsPackageVersion)" /> |
||||
|
<PackageVersion Include="Microsoft.Extensions.FileProviders.Physical" Version="$(MicrosoftExtensionsPackageVersion)" /> |
||||
|
<PackageVersion Include="Microsoft.Extensions.Http" Version="$(MicrosoftExtensionsPackageVersion)" /> |
||||
|
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="$(MicrosoftExtensionsPackageVersion)" /> |
||||
|
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="$(MicrosoftExtensionsPackageVersion)" /> |
||||
|
<PackageVersion Include="Microsoft.Extensions.Options" Version="$(MicrosoftExtensionsPackageVersion)" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<!-- Elsa --> |
||||
|
<ItemGroup> |
||||
|
<PackageVersion Include="Elsa" Version="$(ElsaPackageVersion)" /> |
||||
|
<PackageVersion Include="Elsa.Activities.Email" Version="$(ElsaPackageVersion)" /> |
||||
|
<PackageVersion Include="Elsa.Activities.Http" Version="$(ElsaPackageVersion)" /> |
||||
|
<PackageVersion Include="Elsa.Activities.UserTask" Version="$(ElsaPackageVersion)" /> |
||||
|
<PackageVersion Include="Elsa.Activities.Temporal.Quartz" Version="$(ElsaPackageVersion)" /> |
||||
|
<PackageVersion Include="Elsa.Core" Version="$(ElsaPackageVersion)" /> |
||||
|
<PackageVersion Include="Elsa.Designer.Components.Web" Version="$(ElsaPackageVersion)" /> |
||||
|
<PackageVersion Include="Elsa.Rebus.RabbitMq" Version="$(ElsaPackageVersion)" /> |
||||
|
<PackageVersion Include="Elsa.Server.Api" Version="$(ElsaPackageVersion)" /> |
||||
|
<PackageVersion Include="Elsa.Webhooks.Api" Version="$(ElsaPackageVersion)" /> |
||||
|
<PackageVersion Include="Elsa.Webhooks.Persistence.EntityFramework.Core" Version="$(ElsaPackageVersion)" /> |
||||
|
<PackageVersion Include="Elsa.WorkflowSettings.Persistence.EntityFramework.Core" Version="$(ElsaPackageVersion)" /> |
||||
|
<PackageVersion Include="Elsa.Webhooks.Persistence.EntityFramework.MySql" Version="$(ElsaPackageVersion)" /> |
||||
|
<PackageVersion Include="Elsa.WorkflowSettings.Persistence.EntityFramework.MySql" Version="$(ElsaPackageVersion)" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<!-- DotNetCore.CAP --> |
||||
|
<ItemGroup> |
||||
|
<PackageVersion Include="DotNetCore.CAP" Version="$(DotNetCoreCAPPackageVersion)" /> |
||||
|
<PackageVersion Include="DotNetCore.CAP.Dashboard" Version="$(DotNetCoreCAPPackageVersion)" /> |
||||
|
<PackageVersion Include="DotNetCore.CAP.MySql" Version="$(DotNetCoreCAPPackageVersion)" /> |
||||
|
<PackageVersion Include="DotNetCore.CAP.OpenTelemetry" Version="$(DotNetCoreCAPPackageVersion)" /> |
||||
|
<PackageVersion Include="DotNetCore.CAP.Oracle" Version="$(DotNetCoreCAPPackageVersion)" /> |
||||
|
<PackageVersion Include="DotNetCore.CAP.PostgreSql" Version="$(DotNetCoreCAPPackageVersion)" /> |
||||
|
<PackageVersion Include="DotNetCore.CAP.RabbitMQ" Version="$(DotNetCoreCAPPackageVersion)" /> |
||||
|
<PackageVersion Include="DotNetCore.CAP.SqlServer" Version="$(DotNetCoreCAPPackageVersion)" /> |
||||
|
<PackageVersion Include="DotNetCore.CAP.Sqlite" Version="$(DotNetCoreCAPPackageVersion)" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<!-- Serilog --> |
||||
|
<ItemGroup> |
||||
|
<PackageVersion Include="Serilog" Version="3.1.1" /> |
||||
|
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.0" /> |
||||
|
<PackageVersion Include="Serilog.Enrichers.Environment" Version="2.3.0" /> |
||||
|
<PackageVersion Include="Serilog.Enrichers.Assembly" Version="2.0.0" /> |
||||
|
<PackageVersion Include="Serilog.Enrichers.Process" Version="2.0.2" /> |
||||
|
<PackageVersion Include="Serilog.Enrichers.Thread" Version="3.1.0" /> |
||||
|
<PackageVersion Include="Serilog.Extensions.Hosting" Version="8.0.0" /> |
||||
|
<PackageVersion Include="Serilog.Extensions.Logging" Version="8.0.0" /> |
||||
|
<PackageVersion Include="Serilog.Settings.Configuration" Version="8.0.0" /> |
||||
|
<PackageVersion Include="Serilog.Sinks.Async" Version="1.5.0" /> |
||||
|
<PackageVersion Include="Serilog.Sinks.Console" Version="5.0.0" /> |
||||
|
<PackageVersion Include="Serilog.Sinks.Elasticsearch" Version="9.0.3" /> |
||||
|
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<!-- Test --> |
||||
|
<ItemGroup> |
||||
|
<PackageVersion Include="coverlet.collector" Version="6.0.0" /> |
||||
|
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" /> |
||||
|
<PackageVersion Include="Moq.AutoMock" Version="3.0.0" /> |
||||
|
<PackageVersion Include="NSubstitute" Version="5.1.0" /> |
||||
|
<PackageVersion Include="Shouldly" Version="4.2.1" /> |
||||
|
<PackageVersion Include="xunit" Version="2.6.1" /> |
||||
|
<PackageVersion Include="xunit.extensibility.execution" Version="2.6.1" /> |
||||
|
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<!-- Fody --> |
||||
|
<ItemGroup> |
||||
|
<PackageVersion Include="ConfigureAwait.Fody" Version="3.3.2" /> |
||||
|
<PackageVersion Include="Fody" Version="6.8.0" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<!-- Other --> |
||||
|
<ItemGroup> |
||||
|
<PackageVersion Include="aliyun-net-sdk-core" Version="1.5.10" /> |
||||
|
<PackageVersion Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" /> |
||||
|
<PackageVersion Include="AgileConfig.Client" Version="1.6.9" /> |
||||
|
<PackageVersion Include="Dapr.Client" Version="1.12.0" /> |
||||
|
<PackageVersion Include="Dapr.Actors" Version="1.12.0" /> |
||||
|
<PackageVersion Include="Dapr.Actors.AspNetCore" Version="1.12.0" /> |
||||
|
<PackageVersion Include="DistributedLock.Core" Version="1.0.5" /> |
||||
|
<PackageVersion Include="DistributedLock.Redis" Version="1.0.2" /> |
||||
|
<PackageVersion Include="Hangfire.MySqlStorage" Version="2.0.3" /> |
||||
|
<PackageVersion Include="HangFire.SqlServer" Version="1.8.6" /> |
||||
|
<PackageVersion Include="IdentityModel" Version="6.2.0" /> |
||||
|
<PackageVersion Include="JetBrains.Annotations" Version="2023.3.0" /> |
||||
|
<PackageVersion Include="Markdig" Version="0.34.0" /> |
||||
|
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" /> |
||||
|
<PackageVersion Include="NEST" Version="7.15.1" /> |
||||
|
<PackageVersion Include="NRules" Version="0.9.2" /> |
||||
|
<PackageVersion Include="Ocelot.Provider.Polly" Version="20.0.0" /> |
||||
|
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.8.0" /> |
||||
|
<PackageVersion Include="OpenTelemetry.Exporter.Zipkin" Version="1.8.0" /> |
||||
|
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" /> |
||||
|
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" /> |
||||
|
<PackageVersion Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.0.0-beta.11" /> |
||||
|
<PackageVersion Include="Polly" Version="8.2.0" /> |
||||
|
<PackageVersion Include="Quartz.Serialization.Json" Version="3.7.0" /> |
||||
|
<PackageVersion Include="RulesEngine" Version="4.0.0" /> |
||||
|
<PackageVersion Include="Senparc.Weixin.MP" Version="16.18.9" /> |
||||
|
<PackageVersion Include="SixLabors.ImageSharp" Version="3.0.2" /> |
||||
|
<PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="2.0.1" /> |
||||
|
<PackageVersion Include="StackExchange.Redis" Version="2.7.4" /> |
||||
|
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" /> |
||||
|
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" /> |
||||
|
<PackageVersion Include="Tencent.QCloud.Cos.Sdk" Version="5.4.37" /> |
||||
|
<PackageVersion Include="TencentCloudSDK" Version="3.0.712" /> |
||||
|
<PackageVersion Include="Yarp.ReverseProxy" Version="1.1.1" /> |
||||
|
</ItemGroup> |
||||
|
</Project> |
||||
@ -0,0 +1,12 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<configuration> |
||||
|
<packageSources> |
||||
|
<clear /> |
||||
|
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> |
||||
|
</packageSources> |
||||
|
<packageSourceMapping> |
||||
|
<packageSource key="nuget.org"> |
||||
|
<package pattern="*" /> |
||||
|
</packageSource> |
||||
|
</packageSourceMapping> |
||||
|
</configuration> |
||||
@ -1,81 +0,0 @@ |
|||||
using PackageName.CompanyName.ProjectName.EntityFrameworkCore; |
|
||||
using LINGYUN.Abp.Data.DbMigrator; |
|
||||
using LINGYUN.Abp.MultiTenancy; |
|
||||
using Microsoft.EntityFrameworkCore; |
|
||||
using Microsoft.Extensions.Logging; |
|
||||
using System.Threading.Tasks; |
|
||||
using Volo.Abp.Data; |
|
||||
using Volo.Abp.DependencyInjection; |
|
||||
using Volo.Abp.EventBus.Distributed; |
|
||||
using Volo.Abp.MultiTenancy; |
|
||||
using Volo.Abp.Uow; |
|
||||
|
|
||||
namespace PackageName.CompanyName.ProjectName.EventBus.Handlers; |
|
||||
|
|
||||
public class TenantSynchronizer : |
|
||||
IDistributedEventHandler<CreateEventData>, |
|
||||
ITransientDependency |
|
||||
{ |
|
||||
protected IDataSeeder DataSeeder { get; } |
|
||||
protected ICurrentTenant CurrentTenant { get; } |
|
||||
protected IDbSchemaMigrator DbSchemaMigrator { get; } |
|
||||
protected IUnitOfWorkManager UnitOfWorkManager { get; } |
|
||||
|
|
||||
protected ILogger<TenantSynchronizer> Logger { get; } |
|
||||
|
|
||||
public TenantSynchronizer( |
|
||||
IDataSeeder dataSeeder, |
|
||||
ICurrentTenant currentTenant, |
|
||||
IDbSchemaMigrator dbSchemaMigrator, |
|
||||
IUnitOfWorkManager unitOfWorkManager, |
|
||||
ILogger<TenantSynchronizer> logger) |
|
||||
{ |
|
||||
DataSeeder = dataSeeder; |
|
||||
CurrentTenant = currentTenant; |
|
||||
DbSchemaMigrator = dbSchemaMigrator; |
|
||||
UnitOfWorkManager = unitOfWorkManager; |
|
||||
|
|
||||
Logger = logger; |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 租户创建之后需要预置种子数据
|
|
||||
/// </summary>
|
|
||||
/// <param name="eventData"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public virtual async Task HandleEventAsync(CreateEventData eventData) |
|
||||
{ |
|
||||
using (var unitOfWork = UnitOfWorkManager.Begin()) |
|
||||
{ |
|
||||
using (CurrentTenant.Change(eventData.Id, eventData.Name)) |
|
||||
{ |
|
||||
Logger.LogInformation("Migrating the new tenant database with PackageName.CompanyName.ProjectName..."); |
|
||||
// 迁移租户数据
|
|
||||
await DbSchemaMigrator.MigrateAsync<ProjectNameDbContext>( |
|
||||
(connectionString, builder) => |
|
||||
{ |
|
||||
#if MySQL
|
|
||||
builder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)); |
|
||||
#elif SqlServer
|
|
||||
builder.UseSqlServer(connectionString); |
|
||||
#elif Sqlite
|
|
||||
builder.UseSqlite(connectionString); |
|
||||
#elif Oracle
|
|
||||
builder.UseOracle(connectionString); |
|
||||
#elif OracleDevart
|
|
||||
builder.UseOracle(connectionString); |
|
||||
#elif PostgreSql
|
|
||||
builder.UseNpgsql(connectionString); |
|
||||
#endif
|
|
||||
|
|
||||
return new ProjectNameDbContext(builder.Options); |
|
||||
}); |
|
||||
Logger.LogInformation("Migrated the new tenant database with PackageName.CompanyName.ProjectName..."); |
|
||||
|
|
||||
await DataSeeder.SeedAsync(new DataSeedContext(eventData.Id)); |
|
||||
|
|
||||
await unitOfWork.SaveChangesAsync(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,32 @@ |
|||||
|
using Volo.Abp.Specifications; |
||||
|
|
||||
|
namespace System.Linq.Expressions; |
||||
|
|
||||
|
internal static class ExpressionFuncExtensions |
||||
|
{ |
||||
|
public static Expression<Func<T, bool>> AndIf<T>( |
||||
|
this Expression<Func<T, bool>> first, |
||||
|
bool condition, |
||||
|
Expression<Func<T, bool>> second) |
||||
|
{ |
||||
|
if (condition) |
||||
|
{ |
||||
|
return ExpressionFuncExtender.And(first, second); |
||||
|
} |
||||
|
|
||||
|
return first; |
||||
|
} |
||||
|
|
||||
|
public static Expression<Func<T, bool>> OrIf<T>( |
||||
|
this Expression<Func<T, bool>> first, |
||||
|
bool condition, |
||||
|
Expression<Func<T, bool>> second) |
||||
|
{ |
||||
|
if (condition) |
||||
|
{ |
||||
|
return ExpressionFuncExtender.Or(first, second); |
||||
|
} |
||||
|
|
||||
|
return first; |
||||
|
} |
||||
|
} |
||||
@ -1,53 +1,54 @@ |
|||||
using System.Collections.Generic; |
using LINGYUN.Abp.DataProtection; |
||||
using System.Threading; |
using System.Collections.Generic; |
||||
using System.Threading.Tasks; |
using System.Threading; |
||||
using Volo.Abp.Domain.Entities; |
using System.Threading.Tasks; |
||||
using Volo.Abp.Specifications; |
using Volo.Abp.Domain.Entities; |
||||
|
using Volo.Abp.Specifications; |
||||
namespace PackageName.CompanyName.ProjectName; |
|
||||
/// <summary>
|
namespace PackageName.CompanyName.ProjectName; |
||||
/// 实现接口支持规约化查询
|
/// <summary>
|
||||
/// </summary>
|
/// 基本仓储接口
|
||||
/// <typeparam name="TEntity">实体类型</typeparam>
|
/// </summary>
|
||||
/// <typeparam name="TKey">实体主键类型</typeparam>
|
/// <typeparam name="TEntity">实体类型</typeparam>
|
||||
public interface IProjectNameSpecificationSupport<TEntity, TKey> |
/// <typeparam name="TKey">实体主键类型</typeparam>
|
||||
where TEntity : class, IEntity<TKey> |
public interface IProjectNameBasicRepository<TEntity, TKey> : IDataProtectionRepository<TEntity> |
||||
{ |
where TEntity : class, IEntity<TKey> |
||||
/// <summary>
|
{ |
||||
/// 获取过滤后的实体数量
|
/// <summary>
|
||||
/// </summary>
|
/// 获取过滤后的实体数量
|
||||
/// <param name="specification"></param>
|
/// </summary>
|
||||
/// <param name="cancellationToken"></param>
|
/// <param name="specification"></param>
|
||||
/// <returns></returns>
|
/// <param name="cancellationToken"></param>
|
||||
Task<int> GetCountAsync( |
/// <returns></returns>
|
||||
ISpecification<TEntity> specification, |
Task<int> GetCountAsync( |
||||
CancellationToken cancellationToken = default); |
ISpecification<TEntity> specification, |
||||
/// <summary>
|
CancellationToken cancellationToken = default); |
||||
/// 获取过滤后的实体列表(分页)
|
/// <summary>
|
||||
/// </summary>
|
/// 获取过滤后的实体列表(分页)
|
||||
/// <param name="specification"></param>
|
/// </summary>
|
||||
/// <param name="sorting"></param>
|
/// <param name="specification"></param>
|
||||
/// <param name="maxResultCount"></param>
|
/// <param name="sorting"></param>
|
||||
/// <param name="skipCount"></param>
|
/// <param name="maxResultCount"></param>
|
||||
/// <param name="cancellationToken"></param>
|
/// <param name="skipCount"></param>
|
||||
/// <returns></returns>
|
/// <param name="cancellationToken"></param>
|
||||
Task<List<TEntity>> GetListAsync( |
/// <returns></returns>
|
||||
ISpecification<TEntity> specification, |
Task<List<TEntity>> GetListAsync( |
||||
string sorting = nameof(IEntity<TKey>.Id), |
ISpecification<TEntity> specification, |
||||
int maxResultCount = 10, |
string sorting = nameof(IEntity<TKey>.Id), |
||||
int skipCount = 0, |
int maxResultCount = 10, |
||||
CancellationToken cancellationToken = default); |
int skipCount = 0, |
||||
/// <summary>
|
CancellationToken cancellationToken = default); |
||||
/// 获取过滤后的实体列表
|
/// <summary>
|
||||
/// </summary>
|
/// 获取过滤后的实体列表
|
||||
/// <param name="specification"></param>
|
/// </summary>
|
||||
/// <param name="sorting"></param>
|
/// <param name="specification"></param>
|
||||
/// <param name="maxResultCount"></param>
|
/// <param name="sorting"></param>
|
||||
/// <param name="cancellationToken"></param>
|
/// <param name="maxResultCount"></param>
|
||||
/// <returns></returns>
|
/// <param name="cancellationToken"></param>
|
||||
Task<List<TEntity>> GetListAsync( |
/// <returns></returns>
|
||||
ISpecification<TEntity> specification, |
Task<List<TEntity>> GetListAsync( |
||||
string sorting = nameof(IEntity<TKey>.Id), |
ISpecification<TEntity> specification, |
||||
int maxResultCount = 10, |
string sorting = nameof(IEntity<TKey>.Id), |
||||
CancellationToken cancellationToken = default); |
int maxResultCount = 10, |
||||
} |
CancellationToken cancellationToken = default); |
||||
|
} |
||||
@ -1,11 +1,10 @@ |
|||||
using Volo.Abp.Settings; |
using Volo.Abp.Settings; |
||||
|
|
||||
namespace PackageName.CompanyName.ProjectName.Settings |
namespace PackageName.CompanyName.ProjectName.Settings; |
||||
|
|
||||
|
public class ProjectNameSettingDefinitionProvider : SettingDefinitionProvider |
||||
{ |
{ |
||||
public class ProjectNameSettingDefinitionProvider : SettingDefinitionProvider |
public override void Define(ISettingDefinitionContext context) |
||||
{ |
{ |
||||
public override void Define(ISettingDefinitionContext context) |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,7 +1,6 @@ |
|||||
namespace PackageName.CompanyName.ProjectName.Settings |
namespace PackageName.CompanyName.ProjectName.Settings; |
||||
|
|
||||
|
public static class ProjectNameSettings |
||||
{ |
{ |
||||
public static class ProjectNameSettings |
public const string GroupName = "ProjectName"; |
||||
{ |
|
||||
public const string GroupName = "ProjectName"; |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
150
aspnet-core/templates/content/src/PackageName.CompanyName.ProjectName.EntityFrameworkCore/PackageName/CompanyName/ProjectName/EntityFrameworkCore/EfCoreSpecificationSupportRepository.cs → aspnet-core/templates/content/src/PackageName.CompanyName.ProjectName.EntityFrameworkCore/PackageName/CompanyName/ProjectName/EntityFrameworkCore/EfCoreProjectNameRepository.cs
150
aspnet-core/templates/content/src/PackageName.CompanyName.ProjectName.EntityFrameworkCore/PackageName/CompanyName/ProjectName/EntityFrameworkCore/EfCoreSpecificationSupportRepository.cs → aspnet-core/templates/content/src/PackageName.CompanyName.ProjectName.EntityFrameworkCore/PackageName/CompanyName/ProjectName/EntityFrameworkCore/EfCoreProjectNameRepository.cs
@ -1,73 +1,77 @@ |
|||||
using Microsoft.EntityFrameworkCore; |
using LINGYUN.Abp.DataProtection; |
||||
using System; |
using LINGYUN.Abp.DataProtection.EntityFrameworkCore; |
||||
using System.Collections.Generic; |
using Microsoft.EntityFrameworkCore; |
||||
using System.Linq; |
using System; |
||||
using System.Linq.Dynamic.Core; |
using System.Collections.Generic; |
||||
using System.Threading; |
using System.Linq; |
||||
using System.Threading.Tasks; |
using System.Linq.Dynamic.Core; |
||||
using Volo.Abp.Domain.Entities; |
using System.Threading; |
||||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
using System.Threading.Tasks; |
||||
using Volo.Abp.EntityFrameworkCore; |
using Volo.Abp.Domain.Entities; |
||||
using Volo.Abp.Specifications; |
using Volo.Abp.EntityFrameworkCore; |
||||
|
using Volo.Abp.Specifications; |
||||
namespace PackageName.CompanyName.ProjectName.EntityFrameworkCore; |
|
||||
/// <summary>
|
namespace PackageName.CompanyName.ProjectName.EntityFrameworkCore; |
||||
/// 实现仓储提供规约化查询
|
/// <summary>
|
||||
/// </summary>
|
/// 实现基本接口
|
||||
/// <typeparam name="TEntity">实体类型</typeparam>
|
/// </summary>
|
||||
/// <typeparam name="TKey">实体主键类型</typeparam>
|
/// <typeparam name="TEntity">实体类型</typeparam>
|
||||
public abstract class EfCoreSpecificationSupportRepository<TEntity, TKey> : |
/// <typeparam name="TKey">实体主键类型</typeparam>
|
||||
EfCoreRepository<IProjectNameDbContext, TEntity, TKey>, |
public abstract class EfCoreProjectNameRepository<TEntity, TKey> : |
||||
IProjectNameSpecificationSupport<TEntity, TKey> |
EfCoreDataProtectionRepository<IProjectNameDbContext, TEntity, TKey>, |
||||
where TEntity : class, IEntity<TKey> |
IProjectNameBasicRepository<TEntity, TKey> |
||||
{ |
where TEntity : class, IEntity<TKey> |
||||
protected EfCoreSpecificationSupportRepository( |
{ |
||||
IDbContextProvider<IProjectNameDbContext> dbContextProvider) : base(dbContextProvider) |
protected EfCoreProjectNameRepository( |
||||
{ |
IDbContextProvider<IProjectNameDbContext> dbContextProvider, |
||||
} |
IDataAuthorizationService dataAuthorizationService, |
||||
|
IEntityTypeFilterBuilder entityTypeFilterBuilder) |
||||
public async virtual Task<int> GetCountAsync( |
: base(dbContextProvider, dataAuthorizationService, entityTypeFilterBuilder) |
||||
ISpecification<TEntity> specification, |
{ |
||||
CancellationToken cancellationToken = default) |
} |
||||
{ |
|
||||
return await (await GetDbSetAsync()) |
public async virtual Task<int> GetCountAsync( |
||||
.Where(specification.ToExpression()) |
ISpecification<TEntity> specification, |
||||
.CountAsync(GetCancellationToken(cancellationToken)); |
CancellationToken cancellationToken = default) |
||||
} |
{ |
||||
|
return await (await GetDbSetAsync()) |
||||
public async virtual Task<List<TEntity>> GetListAsync( |
.Where(specification.ToExpression()) |
||||
ISpecification<TEntity> specification, |
.CountAsync(GetCancellationToken(cancellationToken)); |
||||
string sorting = nameof(IEntity<TKey>.Id), |
} |
||||
int maxResultCount = 10, |
|
||||
int skipCount = 0, |
public async virtual Task<List<TEntity>> GetListAsync( |
||||
CancellationToken cancellationToken = default) |
ISpecification<TEntity> specification, |
||||
{ |
string sorting = nameof(IEntity<TKey>.Id), |
||||
return await (await GetDbSetAsync()) |
int maxResultCount = 10, |
||||
.Where(specification.ToExpression()) |
int skipCount = 0, |
||||
.OrderBy(GetSortingOrDefault(sorting)) |
CancellationToken cancellationToken = default) |
||||
.PageBy(skipCount, maxResultCount) |
{ |
||||
.ToListAsync(GetCancellationToken(cancellationToken)); |
return await (await GetDbSetAsync()) |
||||
} |
.Where(specification.ToExpression()) |
||||
|
.OrderBy(GetSortingOrDefault(sorting)) |
||||
public async virtual Task<List<TEntity>> GetListAsync( |
.PageBy(skipCount, maxResultCount) |
||||
ISpecification<TEntity> specification, |
.ToListAsync(GetCancellationToken(cancellationToken)); |
||||
string sorting = nameof(IEntity<TKey>.Id), |
} |
||||
int maxResultCount = 10, |
|
||||
CancellationToken cancellationToken = default) |
public async virtual Task<List<TEntity>> GetListAsync( |
||||
{ |
ISpecification<TEntity> specification, |
||||
return await (await GetDbSetAsync()) |
string sorting = nameof(IEntity<TKey>.Id), |
||||
.Where(specification.ToExpression()) |
int maxResultCount = 10, |
||||
.OrderBy(GetSortingOrDefault(sorting)) |
CancellationToken cancellationToken = default) |
||||
.Take(maxResultCount) |
{ |
||||
.ToListAsync(GetCancellationToken(cancellationToken)); |
return await (await GetDbSetAsync()) |
||||
} |
.Where(specification.ToExpression()) |
||||
|
.OrderBy(GetSortingOrDefault(sorting)) |
||||
protected virtual string GetSortingOrDefault(string sorting = nameof(IEntity<TKey>.Id)) |
.Take(maxResultCount) |
||||
{ |
.ToListAsync(GetCancellationToken(cancellationToken)); |
||||
if (sorting.IsNullOrWhiteSpace()) |
} |
||||
{ |
|
||||
return nameof(IEntity<TKey>.Id); |
protected virtual string GetSortingOrDefault(string sorting = nameof(IEntity<TKey>.Id)) |
||||
} |
{ |
||||
return sorting; |
if (sorting.IsNullOrWhiteSpace()) |
||||
} |
{ |
||||
} |
return nameof(IEntity<TKey>.Id); |
||||
|
} |
||||
|
return sorting; |
||||
|
} |
||||
|
} |
||||
@ -1,12 +1,34 @@ |
|||||
using System; |
using Microsoft.Extensions.Logging; |
||||
using System.Collections.Generic; |
using System; |
||||
using System.Linq; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Data; |
||||
using Volo.Abp.EntityFrameworkCore.Migrations; |
using Volo.Abp.EntityFrameworkCore.Migrations; |
||||
|
using Volo.Abp.EventBus.Distributed; |
||||
|
using Volo.Abp.MultiTenancy; |
||||
|
using Volo.Abp.Uow; |
||||
|
|
||||
namespace PackageName.CompanyName.ProjectName.EntityFrameworkCore; |
namespace PackageName.CompanyName.ProjectName.EntityFrameworkCore; |
||||
|
|
||||
public class ProjectNameDbMigrationEventHandler : EfCoreDatabaseMigrationEventHandlerBase<ProjectNameDbContext> |
public class ProjectNameDbMigrationEventHandler : EfCoreDatabaseMigrationEventHandlerBase<ProjectNameDbContext> |
||||
{ |
{ |
||||
|
protected IDataSeeder DataSeeder { get; } |
||||
|
|
||||
|
public ProjectNameDbMigrationEventHandler( |
||||
|
IDataSeeder dataSeeder, |
||||
|
ITenantStore tenantStore, |
||||
|
ICurrentTenant currentTenant, |
||||
|
IUnitOfWorkManager unitOfWorkManager, |
||||
|
IDistributedEventBus distributedEventBus, |
||||
|
ILoggerFactory loggerFactory) |
||||
|
: base( |
||||
|
ConnectionStringNameAttribute.GetConnStringName<ProjectNameDbContext>(), |
||||
|
currentTenant, unitOfWorkManager, tenantStore, distributedEventBus, loggerFactory) |
||||
|
{ |
||||
|
DataSeeder = dataSeeder; |
||||
|
} |
||||
|
|
||||
|
protected async override Task SeedAsync(Guid? tenantId) |
||||
|
{ |
||||
|
await DataSeeder.SeedAsync(tenantId); |
||||
|
} |
||||
} |
} |
||||
|
|||||
@ -1,234 +1,59 @@ |
|||||
using LINGYUN.Abp.Data.DbMigrator; |
using LINGYUN.Abp.Data.DbMigrator; |
||||
using LINGYUN.Abp.Saas.Tenants; |
using LINGYUN.Abp.Saas.Tenants; |
||||
using Microsoft.EntityFrameworkCore; |
|
||||
using Microsoft.Extensions.Logging; |
using Microsoft.Extensions.Logging; |
||||
using Microsoft.Extensions.Logging.Abstractions; |
|
||||
using PackageName.CompanyName.ProjectName.EntityFrameworkCore; |
using PackageName.CompanyName.ProjectName.EntityFrameworkCore; |
||||
using System; |
using System; |
||||
using System.Collections.Generic; |
|
||||
using System.Diagnostics; |
|
||||
using System.IO; |
|
||||
using System.Linq; |
using System.Linq; |
||||
using System.Runtime.InteropServices; |
|
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Volo.Abp.Data; |
using Volo.Abp.Data; |
||||
using Volo.Abp.DependencyInjection; |
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.DistributedLocking; |
||||
|
using Volo.Abp.EventBus.Distributed; |
||||
using Volo.Abp.MultiTenancy; |
using Volo.Abp.MultiTenancy; |
||||
|
using Volo.Abp.Uow; |
||||
|
|
||||
namespace PackageName.CompanyName.ProjectName.DbMigrator.EntityFrameworkCore; |
namespace PackageName.CompanyName.ProjectName.DbMigrator.EntityFrameworkCore; |
||||
|
|
||||
public class ProjectNameDbMigrationService : ITransientDependency |
public class ProjectNameDbMigrationService : EfCoreRuntimeDbMigratorBase<ProjectNameDbContext>, ITransientDependency |
||||
{ |
{ |
||||
public ILogger<ProjectNameDbMigrationService> Logger { get; set; } |
protected IDataSeeder DataSeeder { get; } |
||||
|
protected IDbSchemaMigrator DbSchemaMigrator { get; } |
||||
private readonly IDataSeeder _dataSeeder; |
protected ITenantRepository TenantRepository { get; } |
||||
private readonly IDbSchemaMigrator _dbSchemaMigrator; |
|
||||
private readonly ITenantRepository _tenantRepository; |
|
||||
private readonly ICurrentTenant _currentTenant; |
|
||||
|
|
||||
public ProjectNameDbMigrationService( |
public ProjectNameDbMigrationService( |
||||
IDataSeeder dataSeeder, |
IDataSeeder dataSeeder, |
||||
IDbSchemaMigrator dbSchemaMigrator, |
IDbSchemaMigrator dbSchemaMigrator, |
||||
ITenantRepository tenantRepository, |
ITenantRepository tenantRepository, |
||||
ICurrentTenant currentTenant) |
ICurrentTenant currentTenant, |
||||
{ |
IUnitOfWorkManager unitOfWorkManager, |
||||
_dataSeeder = dataSeeder; |
IServiceProvider serviceProvider, |
||||
_dbSchemaMigrator = dbSchemaMigrator; |
IAbpDistributedLock abpDistributedLock, |
||||
_tenantRepository = tenantRepository; |
IDistributedEventBus distributedEventBus, |
||||
_currentTenant = currentTenant; |
ILoggerFactory loggerFactory) |
||||
|
: base( |
||||
Logger = NullLogger<ProjectNameDbMigrationService>.Instance; |
ConnectionStringNameAttribute.GetConnStringName<ProjectNameDbContext>(), |
||||
} |
unitOfWorkManager, serviceProvider, currentTenant, abpDistributedLock, distributedEventBus, loggerFactory) |
||||
|
|
||||
public async Task MigrateAsync() |
|
||||
{ |
|
||||
var initialMigrationAdded = AddInitialMigrationIfNotExist(); |
|
||||
|
|
||||
if (initialMigrationAdded) |
|
||||
{ |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
Logger.LogInformation("Started database migrations..."); |
|
||||
|
|
||||
await MigrateDatabaseSchemaAsync(); |
|
||||
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) |
|
||||
{ |
|
||||
Logger.LogInformation($"Migrating schema for {(tenant == null ? "host" : tenant.Name + " tenant")} database..."); |
|
||||
// 迁移租户数据
|
|
||||
await _dbSchemaMigrator.MigrateAsync<ProjectNameDbContext>( |
|
||||
(connectionString, builder) => |
|
||||
{ |
|
||||
#if MySQL
|
|
||||
builder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)); |
|
||||
#elif SqlServer
|
|
||||
builder.UseSqlServer(connectionString); |
|
||||
#elif Sqlite
|
|
||||
builder.UseSqlite(connectionString); |
|
||||
#elif Oracle
|
|
||||
builder.UseOracle(connectionString); |
|
||||
#elif OracleDevart
|
|
||||
builder.UseOracle(connectionString); |
|
||||
#elif PostgreSql
|
|
||||
builder.UseNpgsql(connectionString); |
|
||||
#endif
|
|
||||
|
|
||||
return new ProjectNameDbContext(builder.Options); |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
private async Task SeedDataAsync(Tenant? tenant = null) |
|
||||
{ |
|
||||
Logger.LogInformation($"Executing {(tenant == null ? "host" : tenant.Name + " tenant")} database seed..."); |
|
||||
|
|
||||
await _dataSeeder.SeedAsync(tenant?.Id); |
|
||||
} |
|
||||
|
|
||||
private bool AddInitialMigrationIfNotExist() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
if (!DbMigrationsProjectExists()) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
try |
|
||||
{ |
|
||||
if (!MigrationsFolderExists()) |
|
||||
{ |
|
||||
AddInitialMigration(); |
|
||||
return true; |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
catch (Exception e) |
|
||||
{ |
|
||||
Logger.LogWarning("Couldn't determinate if any migrations exist : " + e.Message); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private bool DbMigrationsProjectExists() |
|
||||
{ |
{ |
||||
return Directory.Exists(GetEntityFrameworkCoreProjectFolderPath()); |
DataSeeder = dataSeeder; |
||||
} |
DbSchemaMigrator = dbSchemaMigrator; |
||||
|
TenantRepository = tenantRepository; |
||||
private bool MigrationsFolderExists() |
|
||||
{ |
|
||||
var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); |
|
||||
|
|
||||
return Directory.Exists(Path.Combine(dbMigrationsProjectFolder, "Migrations")); |
|
||||
} |
|
||||
|
|
||||
private void AddInitialMigration() |
|
||||
{ |
|
||||
Logger.LogInformation("Creating initial migration..."); |
|
||||
|
|
||||
string argumentPrefix; |
|
||||
string fileName; |
|
||||
|
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) |
|
||||
{ |
|
||||
argumentPrefix = "-c"; |
|
||||
fileName = "/bin/bash"; |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
argumentPrefix = "/C"; |
|
||||
fileName = "cmd.exe"; |
|
||||
} |
|
||||
|
|
||||
var procStartInfo = new ProcessStartInfo(fileName, |
|
||||
$"{argumentPrefix} \"abp create-migration-and-run-migrator \"{GetEntityFrameworkCoreProjectFolderPath()}\" --nolayers\"" |
|
||||
); |
|
||||
|
|
||||
try |
|
||||
{ |
|
||||
Process.Start(procStartInfo); |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
throw new Exception("Couldn't run ABP CLI..."); |
|
||||
} |
|
||||
} |
} |
||||
|
|
||||
private string GetEntityFrameworkCoreProjectFolderPath() |
protected async override Task LockAndApplyDatabaseMigrationsAsync() |
||||
{ |
{ |
||||
var slnDirectoryPath = GetSolutionDirectoryPath(); |
await base.LockAndApplyDatabaseMigrationsAsync(); |
||||
|
|
||||
if (slnDirectoryPath == null) |
var tenants = await TenantRepository.GetListAsync(); |
||||
|
foreach (var tenant in tenants.Where(x => x.IsActive)) |
||||
{ |
{ |
||||
throw new Exception("Solution folder not found!"); |
await LockAndApplyDatabaseWithTenantMigrationsAsync(tenant.Id); |
||||
} |
} |
||||
|
|
||||
return Path.Combine(slnDirectoryPath, "PackageName.CompanyName.ProjectName.HttpApi.Host"); |
|
||||
} |
} |
||||
|
|
||||
private string? GetSolutionDirectoryPath() |
protected async override Task SeedAsync() |
||||
{ |
{ |
||||
var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()); |
Logger.LogInformation($"Executing {(!CurrentTenant.IsAvailable ? "host" : CurrentTenant.Name ?? CurrentTenant.GetId().ToString())} database seed..."); |
||||
|
|
||||
while (Directory.GetParent(currentDirectory.FullName) != null) |
|
||||
{ |
|
||||
currentDirectory = Directory.GetParent(currentDirectory.FullName); |
|
||||
|
|
||||
if (Directory.GetFiles(currentDirectory!.FullName).FirstOrDefault(f => f.EndsWith(".sln")) != null) |
|
||||
{ |
|
||||
return currentDirectory.FullName; |
|
||||
} |
|
||||
|
|
||||
// parent host
|
|
||||
currentDirectory = Directory.GetParent(currentDirectory.FullName); |
|
||||
if (Directory.GetFiles(currentDirectory!.FullName).FirstOrDefault(f => f.EndsWith(".sln")) != null) |
|
||||
{ |
|
||||
return currentDirectory.FullName; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
return null; |
await DataSeeder.SeedAsync(CurrentTenant.Id); |
||||
} |
} |
||||
} |
} |
||||
@ -1,6 +1,5 @@ |
|||||
namespace PackageName.CompanyName.ProjectName |
namespace PackageName.CompanyName.ProjectName; |
||||
|
|
||||
|
public abstract class ProjectNameApplicationTestBase : ProjectNameTestBase<ProjectNameApplicationTestModule> |
||||
{ |
{ |
||||
public abstract class ProjectNameApplicationTestBase : ProjectNameTestBase<ProjectNameApplicationTestModule> |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,12 +1,11 @@ |
|||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
|
|
||||
namespace PackageName.CompanyName.ProjectName |
namespace PackageName.CompanyName.ProjectName; |
||||
|
|
||||
|
[DependsOn( |
||||
|
typeof(ProjectNameDomainTestModule), |
||||
|
typeof(ProjectNameApplicationModule) |
||||
|
)] |
||||
|
public class ProjectNameApplicationTestModule : AbpModule |
||||
{ |
{ |
||||
[DependsOn( |
|
||||
typeof(ProjectNameDomainTestModule), |
|
||||
typeof(ProjectNameApplicationModule) |
|
||||
)] |
|
||||
public class ProjectNameApplicationTestModule : AbpModule |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,6 +1,5 @@ |
|||||
namespace PackageName.CompanyName.ProjectName |
namespace PackageName.CompanyName.ProjectName; |
||||
|
|
||||
|
public abstract class ProjectNameDomainTestBase : ProjectNameTestBase<ProjectNameDomainTestModule> |
||||
{ |
{ |
||||
public abstract class ProjectNameDomainTestBase : ProjectNameTestBase<ProjectNameDomainTestModule> |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,12 +1,11 @@ |
|||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
|
|
||||
namespace PackageName.CompanyName.ProjectName |
namespace PackageName.CompanyName.ProjectName; |
||||
|
|
||||
|
[DependsOn( |
||||
|
typeof(ProjectNameTestBaseModule), |
||||
|
typeof(ProjectNameDomainModule) |
||||
|
)] |
||||
|
public class ProjectNameDomainTestModule : AbpModule |
||||
{ |
{ |
||||
[DependsOn( |
|
||||
typeof(ProjectNameTestBaseModule), |
|
||||
typeof(ProjectNameDomainModule) |
|
||||
)] |
|
||||
public class ProjectNameDomainTestModule : AbpModule |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,19 +1,19 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
<PropertyGroup> |
<PropertyGroup> |
||||
<TargetFramework>net8.0</TargetFramework> |
<TargetFramework>net8.0</TargetFramework> |
||||
<RootNamespace /> |
<RootNamespace /> |
||||
<IsPackable>false</IsPackable> |
<IsPackable>false</IsPackable> |
||||
</PropertyGroup> |
</PropertyGroup> |
||||
|
|
||||
<ItemGroup> |
<ItemGroup> |
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
<PackageReference Include="Microsoft.NET.Test.Sdk" /> |
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="$(MicrosoftPackageVersion)" /> |
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" /> |
||||
</ItemGroup> |
</ItemGroup> |
||||
|
|
||||
<ItemGroup> |
<ItemGroup> |
||||
<ProjectReference Include="..\..\src\PackageName.CompanyName.ProjectName.EntityFrameworkCore\PackageName.CompanyName.ProjectName.EntityFrameworkCore.csproj" /> |
<ProjectReference Include="..\..\src\PackageName.CompanyName.ProjectName.EntityFrameworkCore\PackageName.CompanyName.ProjectName.EntityFrameworkCore.csproj" /> |
||||
<ProjectReference Include="..\PackageName.CompanyName.ProjectName.Domain.Tests\PackageName.CompanyName.ProjectName.Domain.Tests.csproj" /> |
<ProjectReference Include="..\PackageName.CompanyName.ProjectName.Domain.Tests\PackageName.CompanyName.ProjectName.Domain.Tests.csproj" /> |
||||
</ItemGroup> |
</ItemGroup> |
||||
|
|
||||
</Project> |
</Project> |
||||
|
|||||
@ -1,6 +1,5 @@ |
|||||
namespace PackageName.CompanyName.ProjectName.EntityFrameworkCore |
namespace PackageName.CompanyName.ProjectName.EntityFrameworkCore; |
||||
|
|
||||
|
public abstract class ProjectNameEntityFrameworkCoreTestBase : ProjectNameTestBase<ProjectNameEntityFrameworkCoreTestModule> |
||||
{ |
{ |
||||
public abstract class ProjectNameEntityFrameworkCoreTestBase : ProjectNameTestBase<ProjectNameEntityFrameworkCoreTestModule> |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue