Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Update to .Net 5.0 & ABP 4.0.0 #17

Merged
merged 8 commits into from
Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"useTabs": false,
"tabWidth": 4
}
6 changes: 6 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="BlazoriseMyGet" value="https://www.myget.org/F/blazorise/api/v3/index.json" />
</packageSources>
</configuration>
5 changes: 3 additions & 2 deletions common.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>0.6.4</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<Version>1.0.0</Version>
<NoWarn>$(NoWarn);CS1591;CS0436</NoWarn>
<AbpProjectType>app</AbpProjectType>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="2.8.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="2.8.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Application.Contracts" Version="2.8.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="2.8.0" />
<PackageReference Include="Volo.Abp.ObjectExtending" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.TenantManagement.Application.Contracts" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="4.0.0-rc.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
using Volo.Abp.Modularity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.PermissionManagement;
using Volo.Abp.TenantManagement;

Expand All @@ -13,10 +14,14 @@ namespace AdminLTEPro
typeof(AbpFeatureManagementApplicationContractsModule),
typeof(AbpIdentityApplicationContractsModule),
typeof(AbpPermissionManagementApplicationContractsModule),
typeof(AbpTenantManagementApplicationContractsModule)
typeof(AbpTenantManagementApplicationContractsModule),
typeof(AbpObjectExtendingModule)
)]
public class AdminLTEProApplicationContractsModule : AbpModule
{

public override void PreConfigureServices(ServiceConfigurationContext context)
{
AdminLTEProDtoExtensions.Configure();
}
}
}
29 changes: 29 additions & 0 deletions src/AdminLTEPro.Application.Contracts/AdminLTEProDtoExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Volo.Abp.Identity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Threading;

namespace AdminLTEPro
{
public static class AdminLTEProDtoExtensions
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();

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
*/
});
}
}
}
12 changes: 6 additions & 6 deletions src/AdminLTEPro.Application/AdminLTEPro.Application.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>AdminLTEPro</RootNamespace>
</PropertyGroup>

Expand All @@ -13,11 +13,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Volo.Abp.Account.Application" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="2.8.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="2.8.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Application" Version="2.8.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Account.Application" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.TenantManagement.Application" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" Version="4.0.0-rc.4" />
</ItemGroup>

</Project>
17 changes: 0 additions & 17 deletions src/AdminLTEPro.Application/AuthTestAppService.cs

This file was deleted.

2 changes: 2 additions & 0 deletions src/AdminLTEPro.Application/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
using System.Runtime.CompilerServices;
[assembly:InternalsVisibleToAttribute("AdminLTEPro.Application.Tests")]
7 changes: 4 additions & 3 deletions src/AdminLTEPro.DbMigrator/AdminLTEPro.DbMigrator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -20,13 +20,14 @@

<ItemGroup>
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Volo.Abp.Autofac" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="4.0.0-rc.4" />
<ProjectReference Include="..\AdminLTEPro.Application.Contracts\AdminLTEPro.Application.Contracts.csproj" />
<ProjectReference Include="..\AdminLTEPro.EntityFrameworkCore.DbMigrations\AdminLTEPro.EntityFrameworkCore.DbMigrations.csproj" />
</ItemGroup>
Expand Down
43 changes: 43 additions & 0 deletions src/AdminLTEPro.DbMigrator/DbMigratorHostedService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using AdminLTEPro.Data;
using Serilog;
using Volo.Abp;

namespace AdminLTEPro.DbMigrator
{
public class DbMigratorHostedService : IHostedService
{
private readonly IHostApplicationLifetime _hostApplicationLifetime;

public DbMigratorHostedService(IHostApplicationLifetime hostApplicationLifetime)
{
_hostApplicationLifetime = hostApplicationLifetime;
}

public async Task StartAsync(CancellationToken cancellationToken)
{
using (var application = AbpApplicationFactory.Create<AdminLTEProDbMigratorModule>(options =>
{
options.UseAutofac();
options.Services.AddLogging(c => c.AddSerilog());
}))
{
application.Initialize();

await application
.ServiceProvider
.GetRequiredService<AdminLTEProDbMigrationService>()
.MigrateAsync();

application.Shutdown();

_hostApplicationLifetime.StopApplication();
}
}

public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
}
}
47 changes: 17 additions & 30 deletions src/AdminLTEPro.DbMigrator/Program.cs
Original file line number Diff line number Diff line change
@@ -1,39 +1,16 @@
using System.IO;
using System.IO;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using AdminLTEPro.Data;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Serilog;
using Serilog.Events;
using Volo.Abp;
using Volo.Abp.Threading;

namespace AdminLTEPro.DbMigrator
{
class Program
{
static void Main(string[] args)
{
ConfigureLogging();

using (var application = AbpApplicationFactory.Create<AdminLTEProDbMigratorModule>(options =>
{
options.UseAutofac();
options.Services.AddLogging(c => c.AddSerilog());
}))
{
application.Initialize();

AsyncHelper.RunSync(
() => application
.ServiceProvider
.GetRequiredService<AdminLTEProDbMigrationService>()
.MigrateAsync()
);

application.Shutdown();
}
}

private static void ConfigureLogging()
static async Task Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Information()
Expand All @@ -45,9 +22,19 @@ private static void ConfigureLogging()
.MinimumLevel.Override("AdminLTEPro", LogEventLevel.Information)
#endif
.Enrich.FromLogContext()
.WriteTo.File(Path.Combine(Directory.GetCurrentDirectory(), "Logs/logs.txt"))
.WriteTo.Console()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.CreateLogger();

await CreateHostBuilder(args).RunConsoleAsync();
}

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureLogging((context, logging) => logging.ClearProviders())
.ConfigureServices((hostContext, services) =>
{
services.AddHostedService<DbMigratorHostedService>();
});
}
}
14 changes: 12 additions & 2 deletions src/AdminLTEPro.DbMigrator/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
"AdminLTEPro_Web": {
"ClientId": "AdminLTEPro_Web",
"ClientSecret": "1q2w3e*",
"RootUrl": "https://localhost:44390"
"RootUrl": "https://localhost:44386"
},
"AdminLTEPro_App": {
"ClientId": "AdminLTEPro_App",
"ClientSecret": "1q2w3e*"
"ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:4200"
},
"AdminLTEPro_Blazor": {
"ClientId": "AdminLTEPro_Blazor",
"RootUrl": "https://localhost:44307"
},
"AdminLTEPro_Swagger": {
"ClientId": "AdminLTEPro_Swagger",
"ClientSecret": "1q2w3e*",
"RootUrl": "https://localhost:44387"
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions src/AdminLTEPro.DbMigrator/tempkey.rsa
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"KeyId": "f788zGVUZh9H-HbWL1S-Mg",
"Parameters": {
"D": "F19hbC5PLO872DszGiJnVoU55ee7XGXmNf0KEKndJ/uGBv5lWklXA0QF80h1ytWXde0jV5isQPB1t7mPhRQlDoDTkywLi1CeOgBPbxzHEfLjZZ5c4olfeX0IJX9BDqgUntY0H1a/+Om/eDu4OZUz3EIJFFZBgz46YZSyTT6ZDvAEdpC/o66sNJmxvJIp+8zVoVDSqBUzxmc+oEamXLg7r2jdymxJMxau1kQFxEGLOrJnNxGsEe8UrYA3qSsm8m/Xg4uOh7RYgnuEEt88+KTvRq+CAMWhN3YNLtOJ3NmXowwE7e1Ma+jih9+UVfxZn14P5+SOJbQ2bYV2sCV+2vBiCQ==",
"DP": "oPiGO/qdOQfFEAS9fMInQnsrNylIZVpDYEVoDJ6/jQfE/IpuwxGcmsaGvCob3SKxZiJRLCWpwJYo1hCh/JOSVGWMkVyELky56nbbkkV5ymKLSGZ4JoetdQs+GchnPdR+k2P9Ij1Kjk13ylubN3htzNhcBASJpOfSEv5pPVzGKX0=",
"DQ": "z6imxLABHkyftbfUUtpeOlPanEHgpuIjmUdp3T1Ju1jziE63UEhuj0GPAXOF17uYxixwYE8JhOJ7+TyIK9oZeI3zH2OzJqQh8f5PCQ/E+0ULXZDeNV/ShDLCTufu3Fis9Rt64uTp/H/l21oMQ79jc0ysa8DTz1ReJLRc5qjL41U=",
"Exponent": "AQAB",
"InverseQ": "ieZcvSt5XYukKJKhXpv5Dm/1RD7iH88cZnhLSTEVTMoOUHoYWmApY5pNLGahbfjA9bxnkBWDYex/i7wE9uNNY5CsA6ovUaQLVJDt3kHvR9W+9QtN8D6jjG2TuRbbOdEg4RqhfjUaDfDIgTJX2Wxc8U98FOvOyGw1HzwUPFZKecM=",
"Modulus": "vk4z1Bmtmbo+gxITcY+FIlXzcO2wTOGlOXK5GMYj/6PUMFt7lbqkc72AkPsrAo5/JE8LYLhWj7fzSKbjvtowHCz5m2t+FlUYmuiKpvvnJsTqvQrckNlbZ1nm071q5PhP3Dar/OksfBhPtAX+c3+NjDnM/w53ccJJNaBDO/s9JYoN7vH5n6ed1pMSK71hmg4MPsxChcnc1f1PpnG2mqyJ253+GEUbj/kRyeBSmCCr9aadov2ZzxIKVaFNagJEHOzanQmorSLpP25GfOHCuy27Zkef94V/qU9elzjbH4uIKslVGx5T6H99TYh0sUGu11NytYJa5WNAZWow95CzurC2vw==",
"P": "4GMCQy+XTNzR5TsgFcdAZv2K6TcQR13fHVvPoxQp/b32V5YUJOBFEUAtqociy5ro4+KzpXP5WPSk1ZtznGKuNZyLq8gTnhpB3rwd0sdo4zxKnQ5nu+n1UhlhWNxg5A9V5TaciUAyPrHWJfLoYTQWygNTgJELQH5zZXi2ihC2uiU=",
"Q": "2R36pamnLAJggkPJxiW5qH6HizZ+bkQVg0BBftMLzkAM8Y9CwTW75GRUzGEJFpMckkw0GZSYb1Uwl3DVUpkcQ8LZ91IPYdPpDlYUshhIxl184M55pnO14besKxJtMZ64zhHKVAR2pBMO0n6W4/1iBXkkQqyPViJxdfvXPJMBbhM="
}
}
23 changes: 14 additions & 9 deletions src/AdminLTEPro.Domain.Shared/AdminLTEPro.Domain.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,27 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>AdminLTEPro</RootNamespace>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="2.8.0" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain.Shared" Version="2.8.0" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain.Shared" Version="2.8.0" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="2.8.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain.Shared" Version="2.8.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain.Shared" Version="2.8.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Shared" Version="2.8.0" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain.Shared" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain.Shared" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain.Shared" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain.Shared" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Shared" Version="4.0.0-rc.4" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="4.0.0-rc.4" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Localization\AdminLTEPro\*.json" />
<Content Remove="Localization\AdminLTEPro\*.json" />
</ItemGroup>

</Project>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.0" />
</ItemGroup>

</Project>
Loading