Skip to content

Commit

Permalink
Merge pull request #19 from jxnkwlp/feature/dotnet9
Browse files Browse the repository at this point in the history
update to abp 9.0
  • Loading branch information
jxnkwlp authored Nov 25, 2024
2 parents 2c0a40c + 19957b3 commit 71055c6
Show file tree
Hide file tree
Showing 114 changed files with 3,001 additions and 351 deletions.
6 changes: 4 additions & 2 deletions common.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<Project>

<PropertyGroup>
<MicrosoftPackageVersion>8.0.6</MicrosoftPackageVersion>
<AbpVersion>8.3.0</AbpVersion>
<Nullable>enable</Nullable>
<Tfw>net9.0</Tfw>
<MicrosoftPackageVersion>9.0.0</MicrosoftPackageVersion>
<AbpVersion>9.0.0</AbpVersion>
<ModuleVersion>1.6.0</ModuleVersion>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Sample.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
using Volo.Abp.Authorization.Permissions;

namespace Sample.Permissions;

Expand All @@ -12,9 +10,4 @@ public override void Define(IPermissionDefinitionContext context)
//Define your own permissions here. Example:
//myGroup.AddPermission(SamplePermissions.MyPermission1, L("Permission:MyPermission1"));
}

private static LocalizableString L(string name)
{
return LocalizableString.Create<SampleResource>(name);
}
}
26 changes: 12 additions & 14 deletions host/src/Sample.Application.Contracts/SampleDtoExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Volo.Abp.Identity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Threading;
using Volo.Abp.Threading;

namespace Sample;

Expand All @@ -12,17 +10,17 @@ public static void Configure()
{
OneTimeRunner.Run(() =>
{
/* You can add extension properties to DTOs
* defined in the depended modules.
*
* Example:
*
* ObjectExtensionManager.Instance
* .AddOrUpdateProperty<IdentityRoleDto, string>("Title");
*
* See the documentation for more:
* https://docs.abp.io/en/abp/latest/Object-Extensions
*/
/* You can add extension properties to DTOs
* defined in the depended modules.
*
* Example:
*
* ObjectExtensionManager.Instance
* .AddOrUpdateProperty<IdentityRoleDto, string>("Title");
*
* See the documentation for more:
* https://docs.abp.io/en/abp/latest/Object-Extensions
*/
});
}
}
2 changes: 1 addition & 1 deletion host/src/Sample.Application/Sample.Application.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>$(Tfw)</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>Sample</RootNamespace>
</PropertyGroup>
Expand Down
8 changes: 4 additions & 4 deletions host/src/Sample.DbMigrator/DbMigratorHostedService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public virtual async Task StartAsync(CancellationToken cancellationToken)
{
using (var application = await AbpApplicationFactory.CreateAsync<SampleDbMigratorModule>(options =>
{
options.Services.ReplaceConfiguration(_configuration);
options.UseAutofac();
options.Services.AddLogging(c => c.AddSerilog());
options.AddDataMigrationEnvironment();
options.Services.ReplaceConfiguration(_configuration);
options.UseAutofac();
options.Services.AddLogging(c => c.AddSerilog());
options.AddDataMigrationEnvironment();
}))
{
await application.InitializeAsync();
Expand Down
8 changes: 2 additions & 6 deletions host/src/Sample.DbMigrator/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.IO;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -9,7 +8,7 @@

namespace Sample.DbMigrator;

class Program
static class Program
{
static async Task Main(string[] args)
{
Expand All @@ -34,8 +33,5 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.AddAppSettingsSecretsJson()
.ConfigureLogging((context, logging) => logging.ClearProviders())
.ConfigureServices((hostContext, services) =>
{
services.AddHostedService<DbMigratorHostedService>();
});
.ConfigureServices((hostContext, services) => services.AddHostedService<DbMigratorHostedService>());
}
4 changes: 2 additions & 2 deletions host/src/Sample.DbMigrator/Sample.DbMigrator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>$(Tfw)</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand All @@ -13,7 +13,7 @@
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.*" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="$(MicrosoftPackageVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion host/src/Sample.DbMigrator/SampleDbMigratorModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ namespace Sample.DbMigrator;
)]
public class SampleDbMigratorModule : AbpModule
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ namespace Sample.Localization;
[LocalizationResourceName("Sample")]
public class SampleResource
{

}
4 changes: 2 additions & 2 deletions host/src/Sample.Domain.Shared/Sample.Domain.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\common.props" />

Expand Down Expand Up @@ -26,7 +26,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.*" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="$(MicrosoftPackageVersion)" />
</ItemGroup>

</Project>
12 changes: 3 additions & 9 deletions host/src/Sample.Domain.Shared/SampleDomainSharedModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Sample;
typeof(AbpOpenIddictDomainSharedModule),
typeof(AbpPermissionManagementDomainSharedModule),
typeof(AbpSettingManagementDomainSharedModule),
typeof(AbpTenantManagementDomainSharedModule)
typeof(AbpTenantManagementDomainSharedModule)
)]
public class SampleDomainSharedModule : AbpModule
{
Expand All @@ -35,10 +35,7 @@ public override void PreConfigureServices(ServiceConfigurationContext context)

public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<SampleDomainSharedModule>();
});
Configure<AbpVirtualFileSystemOptions>(options => options.FileSets.AddEmbedded<SampleDomainSharedModule>());

Configure<AbpLocalizationOptions>(options =>
{
Expand All @@ -50,9 +47,6 @@ public override void ConfigureServices(ServiceConfigurationContext context)
options.DefaultResourceType = typeof(SampleResource);
});

Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("Sample", typeof(SampleResource));
});
Configure<AbpExceptionLocalizationOptions>(options => options.MapCodeNamespace("Sample", typeof(SampleResource)));
}
}
14 changes: 7 additions & 7 deletions host/src/Sample.Domain.Shared/SampleGlobalFeatureConfigurator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ public static void Configure()
{
OneTimeRunner.Run(() =>
{
/* You can configure (enable/disable) global features of the used modules here.
*
* YOU CAN SAFELY DELETE THIS CLASS AND REMOVE ITS USAGES IF YOU DON'T NEED TO IT!
*
* Please refer to the documentation to lear more about the Global Features System:
* https://docs.abp.io/en/abp/latest/Global-Features
*/
/* You can configure (enable/disable) global features of the used modules here.
*
* YOU CAN SAFELY DELETE THIS CLASS AND REMOVE ITS USAGES IF YOU DON'T NEED TO IT!
*
* Please refer to the documentation to lear more about the Global Features System:
* https://docs.abp.io/en/abp/latest/Global-Features
*/
});
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Identity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Threading;
using Volo.Abp.Threading;

namespace Sample;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private async Task CreateApplicationsAsync()
var webClientId = configurationSection["Sample_Web:ClientId"];
if (!webClientId.IsNullOrWhiteSpace())
{
var webClientRootUrl = configurationSection["Sample_Web:RootUrl"].EnsureEndsWith('/');
var webClientRootUrl = configurationSection["Sample_Web:RootUrl"]!.EnsureEndsWith('/');

/* Sample_Web client is only needed if you created a tiered
* solution. Otherwise, you can delete this client. */
Expand Down Expand Up @@ -156,7 +156,7 @@ await CreateApplicationAsync(
var blazorServerTieredClientId = configurationSection["Sample_BlazorServerTiered:ClientId"];
if (!blazorServerTieredClientId.IsNullOrWhiteSpace())
{
var blazorServerTieredRootUrl = configurationSection["Sample_BlazorServerTiered:RootUrl"].EnsureEndsWith('/');
var blazorServerTieredRootUrl = configurationSection["Sample_BlazorServerTiered:RootUrl"]!.EnsureEndsWith('/');

await CreateApplicationAsync(
name: blazorServerTieredClientId!,
Expand Down
2 changes: 1 addition & 1 deletion host/src/Sample.Domain/Sample.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>$(Tfw)</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>Sample</RootNamespace>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.IO;
using System.IO;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Identity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Threading;
using Volo.Abp.Threading;

namespace Sample.EntityFrameworkCore;

Expand All @@ -16,29 +13,29 @@ public static void Configure()

OneTimeRunner.Run(() =>
{
/* You can configure extra properties for the
* entities defined in the modules used by your application.
*
* This class can be used to map these extra properties to table fields in the database.
*
* USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING.
* USE SampleModuleExtensionConfigurator CLASS (in the Domain.Shared project)
* FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES
*
* Example: Map a property to a table field:
/* You can configure extra properties for the
* entities defined in the modules used by your application.
*
* This class can be used to map these extra properties to table fields in the database.
*
* USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING.
* USE SampleModuleExtensionConfigurator CLASS (in the Domain.Shared project)
* FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES
*
* Example: Map a property to a table field:
ObjectExtensionManager.Instance
.MapEfCoreProperty<IdentityUser, string>(
"MyProperty",
(entityBuilder, propertyBuilder) =>
{
propertyBuilder.HasMaxLength(128);
}
);
ObjectExtensionManager.Instance
.MapEfCoreProperty<IdentityUser, string>(
"MyProperty",
(entityBuilder, propertyBuilder) =>
{
propertyBuilder.HasMaxLength(128);
}
);
* See the documentation for more:
* https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities
*/
* See the documentation for more:
* https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities
*/
});
}
}
Loading

0 comments on commit 71055c6

Please sign in to comment.