-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #544 from MatteoZampariniDev/architecture-refactor
Application Layer refactor
- Loading branch information
Showing
553 changed files
with
6,623 additions
and
5,051 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,29 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<RootNamespace>CleanArchitecture.Blazor.Application</RootNamespace> | ||
<AssemblyName>CleanArchitecture.Blazor.Application</AssemblyName> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Ardalis.Specification" Version="7.0.0" /> | ||
<PackageReference Include="Ardalis.Specification.EntityFrameworkCore" Version="7.0.0" /> | ||
<PackageReference Include="ClosedXML" Version="0.102.1" /> | ||
<PackageReference Include="jcamp.FluentEmail.Core" Version="3.2.0" /> | ||
<PackageReference Include="jcamp.FluentEmail.MailKit" Version="3.2.0" /> | ||
<PackageReference Include="jcamp.FluentEmail.Razor" Version="3.2.0" /> | ||
<PackageReference Include="MailKit" Version="4.2.0" /> | ||
<PackageReference Include="AutoMapper" Version="12.0.1" /> | ||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" /> | ||
<PackageReference Include="FluentValidation" Version="11.7.1" /> | ||
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.7.1" /> | ||
<PackageReference Include="Fluxor.Blazor.Web" Version="5.9.1" /> | ||
<PackageReference Include="Fluxor.Blazor.Web.ReduxDevTools" Version="5.9.1" /> | ||
<PackageReference Include="LazyCache" Version="2.4.0" /> | ||
<PackageReference Include="LazyCache.AspNetCore" Version="2.4.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.12" /> | ||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.12" /> | ||
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.1" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.4" /> | ||
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.12" /> | ||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.5" /> | ||
<PackageReference Include="Hangfire.Core" Version="1.8.5" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Domain\Domain.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="Common\Specification\" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<RootNamespace>CleanArchitecture.Blazor.Application</RootNamespace> | ||
<AssemblyName>CleanArchitecture.Blazor.Application</AssemblyName> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Ardalis.Specification" Version="7.0.0" /> | ||
<PackageReference Include="Ardalis.Specification.EntityFrameworkCore" Version="7.0.0" /> | ||
<PackageReference Include="ClosedXML" Version="0.102.1" /> | ||
<PackageReference Include="jcamp.FluentEmail.Core" Version="3.2.0" /> | ||
<PackageReference Include="AutoMapper" Version="12.0.1" /> | ||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" /> | ||
<PackageReference Include="FluentValidation" Version="11.8.0" /> | ||
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.8.0" /> | ||
<PackageReference Include="LazyCache" Version="2.4.0" /> | ||
<PackageReference Include="LazyCache.AspNetCore" Version="2.4.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.13" /> | ||
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.2" /> | ||
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.13" /> | ||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.5" /> | ||
<PackageReference Include="Hangfire.Core" Version="1.8.6" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Domain\Domain.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using FluentValidation.Results; | ||
|
||
namespace CleanArchitecture.Blazor.Application.Common.Extensions; | ||
public static class ValidationExtensions | ||
{ | ||
public static async Task<List<ValidationFailure>> ValidateAsync<TRequest>(this IEnumerable<IValidator<TRequest>> validators, ValidationContext<TRequest> validationContext, CancellationToken cancellationToken = default) | ||
{ | ||
if (!validators.Any()) return new List<ValidationFailure>(); | ||
|
||
var validationResults = await Task.WhenAll( | ||
validators.Select(v => v.ValidateAsync(validationContext, cancellationToken))); | ||
|
||
return validationResults | ||
.SelectMany(r => r.Errors) | ||
.Where(f => f != null) | ||
.ToList(); | ||
} | ||
|
||
public static Dictionary<string, string[]> ToDictionary(this List<ValidationFailure>? failures) | ||
{ | ||
return failures != null && failures.Any() | ||
? failures.GroupBy(e => e.PropertyName, e => e.ErrorMessage) | ||
.ToDictionary(g => g.Key, g => g.ToArray()) | ||
: new Dictionary<string, string[]>(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace CleanArchitecture.Blazor.Application.Common.Interfaces; | ||
|
||
// TODO: can be improved or removed using MediatR? | ||
public interface IApplicationHubWrapper | ||
{ | ||
Task JobStarted(string message); | ||
Task JobCompleted(string message); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace CleanArchitecture.Blazor.Application.Common.Interfaces; | ||
public interface IApplicationSettings | ||
{ | ||
/// <summary> | ||
/// Current application version | ||
/// </summary> | ||
string Version { get; } | ||
|
||
/// <summary> | ||
/// Application framework | ||
/// </summary> | ||
|
||
string App { get; } | ||
|
||
/// <summary> | ||
/// The application name / title | ||
/// </summary> | ||
string AppName { get; } | ||
} |
Oops, something went wrong.