Skip to content

Commit 85bbb35

Browse files
authored
Merge pull request #553 from neozhu/dev
✨ Application Layer refactor
2 parents b152476 + 02fd30d commit 85bbb35

File tree

553 files changed

+6623
-5051
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

553 files changed

+6623
-5051
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,4 +356,4 @@ MigrationBackup/
356356

357357

358358
**/Files/
359-
src/Blazor.Server.UI/appsettings.development.json
359+
src/Server.UI/appsettings.development.json

.template.config/template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"*.nupkg",
3737
"launchSettings.json",
3838
"*.exe",
39-
"src/Blazor.Server.UI/Files/**"
39+
"src/Server.UI/Files/**"
4040
]
4141
}
4242
]

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"request": "launch",
1111
"preLaunchTask": "build",
1212
// If you have changed target frameworks, make sure to update the program path.
13-
"program": "${workspaceFolder}/src/Blazor.Server.UI/bin/Debug/net6.0/Blazor.Server.UI.dll",
13+
"program": "${workspaceFolder}/src/Server.UI/bin/Debug/net6.0/CleanArchitecture.Blazor.Server.UI.dll",
1414
"args": [],
15-
"cwd": "${workspaceFolder}/src/Blazor.Server.UI",
15+
"cwd": "${workspaceFolder}/src/Server.UI",
1616
"stopAtEntry": false,
1717
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
1818
"serverReadyAction": {

.vscode/tasks.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"type": "process",
88
"args": [
99
"build",
10-
"${workspaceFolder}/src/Blazor.Server.UI/Blazor.Server.UI.csproj",
10+
"${workspaceFolder}/src/Server.UI/Server.UI.csproj",
1111
"/property:GenerateFullPaths=true",
1212
"/consoleloggerparameters:NoSummary"
1313
],
@@ -19,7 +19,7 @@
1919
"type": "process",
2020
"args": [
2121
"publish",
22-
"${workspaceFolder}/src/Blazor.Server.UI/Blazor.Server.UI.csproj",
22+
"${workspaceFolder}/src/Server.UI/Server.UI.csproj",
2323
"/property:GenerateFullPaths=true",
2424
"/consoleloggerparameters:NoSummary"
2525
],
@@ -33,7 +33,7 @@
3333
"watch",
3434
"run",
3535
"--project",
36-
"${workspaceFolder}/src/Blazor.Server.UI/Blazor.Server.UI.csproj"
36+
"${workspaceFolder}/src/Server.UI/Server.UI.csproj"
3737
],
3838
"problemMatcher": "$msCompile"
3939
}

CleanArchitecture.Blazor.sln

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Domain", "src\Domain\Domain
2222
EndProject
2323
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Infrastructure", "src\Infrastructure\Infrastructure.csproj", "{D5A42BE7-D229-4746-9D2A-AC878F79DBED}"
2424
EndProject
25-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor.Server.UI", "src\Blazor.Server.UI\Blazor.Server.UI.csproj", "{66AFF428-DE0D-4F7A-B5D4-B321DE267A15}"
26-
EndProject
2725
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{6BD2EC46-FA8F-44F3-AF33-903BBB347116}"
2826
EndProject
2927
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Application.IntegrationTests", "tests\Application.IntegrationTests\Application.IntegrationTests.csproj", "{4AF55920-007C-411D-8AD3-6F9D2C722450}"
@@ -40,6 +38,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migrators.PostgreSQL", "src
4038
EndProject
4139
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migrators.SqLite", "src\Migrators\Migrators.SqLite\Migrators.SqLite.csproj", "{469D68F1-379E-46A6-AAC3-CD1E4C0E7D77}"
4240
EndProject
41+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server.UI", "src\Server.UI\Server.UI.csproj", "{3E4AF4E5-02EE-4F26-9B6D-8723670172B3}"
42+
EndProject
43+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server", "src\Server\Server.csproj", "{E5008BA6-6358-413C-A082-AF14115EF18B}"
44+
EndProject
4345
Global
4446
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4547
Debug|Any CPU = Debug|Any CPU
@@ -58,10 +60,6 @@ Global
5860
{D5A42BE7-D229-4746-9D2A-AC878F79DBED}.Debug|Any CPU.Build.0 = Debug|Any CPU
5961
{D5A42BE7-D229-4746-9D2A-AC878F79DBED}.Release|Any CPU.ActiveCfg = Release|Any CPU
6062
{D5A42BE7-D229-4746-9D2A-AC878F79DBED}.Release|Any CPU.Build.0 = Release|Any CPU
61-
{66AFF428-DE0D-4F7A-B5D4-B321DE267A15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
62-
{66AFF428-DE0D-4F7A-B5D4-B321DE267A15}.Debug|Any CPU.Build.0 = Debug|Any CPU
63-
{66AFF428-DE0D-4F7A-B5D4-B321DE267A15}.Release|Any CPU.ActiveCfg = Release|Any CPU
64-
{66AFF428-DE0D-4F7A-B5D4-B321DE267A15}.Release|Any CPU.Build.0 = Release|Any CPU
6563
{6BD2EC46-FA8F-44F3-AF33-903BBB347116}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6664
{6BD2EC46-FA8F-44F3-AF33-903BBB347116}.Debug|Any CPU.Build.0 = Debug|Any CPU
6765
{6BD2EC46-FA8F-44F3-AF33-903BBB347116}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -90,6 +88,14 @@ Global
9088
{469D68F1-379E-46A6-AAC3-CD1E4C0E7D77}.Debug|Any CPU.Build.0 = Debug|Any CPU
9189
{469D68F1-379E-46A6-AAC3-CD1E4C0E7D77}.Release|Any CPU.ActiveCfg = Release|Any CPU
9290
{469D68F1-379E-46A6-AAC3-CD1E4C0E7D77}.Release|Any CPU.Build.0 = Release|Any CPU
91+
{3E4AF4E5-02EE-4F26-9B6D-8723670172B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
92+
{3E4AF4E5-02EE-4F26-9B6D-8723670172B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
93+
{3E4AF4E5-02EE-4F26-9B6D-8723670172B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
94+
{3E4AF4E5-02EE-4F26-9B6D-8723670172B3}.Release|Any CPU.Build.0 = Release|Any CPU
95+
{E5008BA6-6358-413C-A082-AF14115EF18B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
96+
{E5008BA6-6358-413C-A082-AF14115EF18B}.Debug|Any CPU.Build.0 = Debug|Any CPU
97+
{E5008BA6-6358-413C-A082-AF14115EF18B}.Release|Any CPU.ActiveCfg = Release|Any CPU
98+
{E5008BA6-6358-413C-A082-AF14115EF18B}.Release|Any CPU.Build.0 = Release|Any CPU
9399
EndGlobalSection
94100
GlobalSection(SolutionProperties) = preSolution
95101
HideSolutionNode = FALSE
@@ -98,14 +104,15 @@ Global
98104
{196FC2C6-2817-494B-AB9D-26F9DD33247A} = {21DC0B96-ED87-4130-BA8D-E8CF73903344}
99105
{AAD8A88D-2BBE-4C6E-A4CA-02D9005BF3DF} = {21DC0B96-ED87-4130-BA8D-E8CF73903344}
100106
{D5A42BE7-D229-4746-9D2A-AC878F79DBED} = {21DC0B96-ED87-4130-BA8D-E8CF73903344}
101-
{66AFF428-DE0D-4F7A-B5D4-B321DE267A15} = {21DC0B96-ED87-4130-BA8D-E8CF73903344}
102107
{4AF55920-007C-411D-8AD3-6F9D2C722450} = {E5DE00AF-3C91-41CE-B37C-2C46F97739F3}
103108
{92C7B430-4830-4ECB-B195-7AA306F1ED21} = {E5DE00AF-3C91-41CE-B37C-2C46F97739F3}
104109
{CA0BF3A4-392B-41AC-AAEF-C83A59913499} = {E5DE00AF-3C91-41CE-B37C-2C46F97739F3}
105110
{5C45543E-B3FA-4C1F-9D7D-DA2E6654BD61} = {21DC0B96-ED87-4130-BA8D-E8CF73903344}
106111
{910C5689-CC8A-4E5B-8894-B00515C90466} = {5C45543E-B3FA-4C1F-9D7D-DA2E6654BD61}
107112
{08778353-0814-41BB-B49E-36BBA8D7751D} = {5C45543E-B3FA-4C1F-9D7D-DA2E6654BD61}
108113
{469D68F1-379E-46A6-AAC3-CD1E4C0E7D77} = {5C45543E-B3FA-4C1F-9D7D-DA2E6654BD61}
114+
{3E4AF4E5-02EE-4F26-9B6D-8723670172B3} = {21DC0B96-ED87-4130-BA8D-E8CF73903344}
115+
{E5008BA6-6358-413C-A082-AF14115EF18B} = {21DC0B96-ED87-4130-BA8D-E8CF73903344}
109116
EndGlobalSection
110117
GlobalSection(ExtensibilityGlobals) = postSolution
111118
SolutionGuid = {384CDE06-46A5-4FC5-AED4-7B23339EA56F}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ Blazor technology.
3434

3535
### How to select a specific Database?
3636

37-
1. Open the `appsettings.json` file located in the src directory of the `Blazor.Server.UI` project.
37+
1. Open the `appsettings.json` file located in the src directory of the `Server.UI` project.
3838
2. Change the setting `DBProvider` to the desired provider name (See Supported Databases).
3939
3. Change the `ConnectionString` to a connection string, which works for your selected database provider.
4040

4141
## Docker compose https deployment
4242

4343
- Create self-signed development certificates for the project
44-
- cmd: `dotnet dev-certs https -ep $env:USERPROFILE\.aspnet\https\Blazor.Server.UI.pfx -p Password@123`
44+
- cmd: `dotnet dev-certs https -ep $env:USERPROFILE\.aspnet\https\CleanArchitecture.Blazor.Server.UI.pfx -p Password@123`
4545
- cmd: `dotnet dev-certs https --trust`
4646
- Manage User secrets to save the password
4747
- cmd: `dotnet user-secrets init`
48-
- cmd: `dotnet user-secrets -p Blazor.Server.UI.csproj set "Kestrel:Certificates:Development:Password" "Password@123"`
48+
- cmd: `dotnet user-secrets -p Server.UI.csproj set "Kestrel:Certificates:Development:Password" "Password@123"`
4949

5050
## Code Generator Extension for visual studio.net 2022
5151

docker-compose.dcproj

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,11 @@
1212
<None Include="docker-compose.yml" />
1313
<None Include="docker-compose.override.yml" />
1414
<None Include=".dockerignore" />
15-
<None Include="src\Blazor.Server.UI\Pages\Identity\Users\Users.razor.cs" />
16-
<None Include="src\Blazor.Server.UI\Shared\UserLoginState.razor.cs" />
17-
</ItemGroup>
18-
<ItemGroup>
19-
<None Remove="launchSettings.json" />
20-
</ItemGroup>
21-
<ItemGroup>
22-
<None Remove="launchSettings.json" />
2315
</ItemGroup>
2416
<ItemGroup>
2517
<None Remove="launchSettings.json" />
2618
</ItemGroup>
2719
<ItemGroup>
2820
<None Remove="src\**" />
2921
</ItemGroup>
30-
<ItemGroup>
31-
<None Include="src\Blazor.Server.UI\Pages\Identity\Users\Profile.razor.cs" />
32-
</ItemGroup>
3322
</Project>

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ services:
55
image: ${DOCKER_REGISTRY-}blazorserver
66
build:
77
context: .
8-
dockerfile: src/Blazor.Server.UI/Dockerfile
8+
dockerfile: src/Server.UI/Dockerfile
99
environment:
1010
- ASPNETCORE_ENVIRONMENT=Development
1111
- UseInMemoryDatabase=true
1212
- ConnectionStrings__DefaultConnection=Server=sqldb;Database=BlazorDashboardDb;User=sa;Password=Password@123;MultipleActiveResultSets=true
1313
- ASPNETCORE_URLS=https://+:443;http://+:80
1414
#- ASPNETCORE_Kestrel__Certificates__Default__Password=Password@123
15-
#- ASPNETCORE_Kestrel__Certificates__Default__Path=/root/.aspnet/https/Blazor.Server.UI.pfx
15+
#- ASPNETCORE_Kestrel__Certificates__Default__Path=/root/.aspnet/https/CleanArchitecture.Blazor.Server.UI.pfx
1616
volumes:
1717
- ${APPDATA}\microsoft\UserSecrets\:/root/.microsoft/usersecrets:ro
1818
- ~/.aspnet/https:/root/.aspnet/https:ro

src/Application/Application.csproj

Lines changed: 27 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,29 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
4-
<RootNamespace>CleanArchitecture.Blazor.Application</RootNamespace>
5-
<AssemblyName>CleanArchitecture.Blazor.Application</AssemblyName>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<Nullable>enable</Nullable>
8-
</PropertyGroup>
9-
<ItemGroup>
10-
<PackageReference Include="Ardalis.Specification" Version="7.0.0" />
11-
<PackageReference Include="Ardalis.Specification.EntityFrameworkCore" Version="7.0.0" />
12-
<PackageReference Include="ClosedXML" Version="0.102.1" />
13-
<PackageReference Include="jcamp.FluentEmail.Core" Version="3.2.0" />
14-
<PackageReference Include="jcamp.FluentEmail.MailKit" Version="3.2.0" />
15-
<PackageReference Include="jcamp.FluentEmail.Razor" Version="3.2.0" />
16-
<PackageReference Include="MailKit" Version="4.2.0" />
17-
<PackageReference Include="AutoMapper" Version="12.0.1" />
18-
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
19-
<PackageReference Include="FluentValidation" Version="11.7.1" />
20-
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.7.1" />
21-
<PackageReference Include="Fluxor.Blazor.Web" Version="5.9.1" />
22-
<PackageReference Include="Fluxor.Blazor.Web.ReduxDevTools" Version="5.9.1" />
23-
<PackageReference Include="LazyCache" Version="2.4.0" />
24-
<PackageReference Include="LazyCache.AspNetCore" Version="2.4.0" />
25-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.12" />
26-
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.12" />
27-
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.1" />
28-
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.4" />
29-
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.12" />
30-
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.5" />
31-
<PackageReference Include="Hangfire.Core" Version="1.8.5" />
32-
</ItemGroup>
33-
<ItemGroup>
34-
<ProjectReference Include="..\Domain\Domain.csproj" />
35-
</ItemGroup>
36-
<ItemGroup>
37-
<Folder Include="Common\Specification\" />
38-
</ItemGroup>
2+
<PropertyGroup>
3+
<TargetFramework>net7.0</TargetFramework>
4+
<RootNamespace>CleanArchitecture.Blazor.Application</RootNamespace>
5+
<AssemblyName>CleanArchitecture.Blazor.Application</AssemblyName>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
<ItemGroup>
10+
<PackageReference Include="Ardalis.Specification" Version="7.0.0" />
11+
<PackageReference Include="Ardalis.Specification.EntityFrameworkCore" Version="7.0.0" />
12+
<PackageReference Include="ClosedXML" Version="0.102.1" />
13+
<PackageReference Include="jcamp.FluentEmail.Core" Version="3.2.0" />
14+
<PackageReference Include="AutoMapper" Version="12.0.1" />
15+
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
16+
<PackageReference Include="FluentValidation" Version="11.8.0" />
17+
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.8.0" />
18+
<PackageReference Include="LazyCache" Version="2.4.0" />
19+
<PackageReference Include="LazyCache.AspNetCore" Version="2.4.0" />
20+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.13" />
21+
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.2" />
22+
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.13" />
23+
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.5" />
24+
<PackageReference Include="Hangfire.Core" Version="1.8.6" />
25+
</ItemGroup>
26+
<ItemGroup>
27+
<ProjectReference Include="..\Domain\Domain.csproj" />
28+
</ItemGroup>
3929
</Project>

src/Application/Common/Behaviours/ValidationBehaviour.cs

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)