Skip to content
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
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ jobs:
dotnet pack ./Email/Core/Odin.Email.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Logging/Core/Odin.Logging.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Messaging/RabbitMq/Odin.Messaging.RabbitMq.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Patterns/CommandHandler/Odin.Patterns.CommandHandler.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Patterns/Commands/Odin.Patterns.Commands.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Patterns/Queries/Odin.Patterns.Queries.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./Patterns/Notifications/Odin.Patterns.Notifications.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./RemoteFiles/Abstractions/Odin.RemoteFiles.Abstractions.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./RemoteFiles/SFTP/Odin.RemoteFiles.SFTP.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
dotnet pack ./RemoteFiles/Core/Odin.RemoteFiles.csproj --configuration $CONFIGURATION --output $PACKAGE_DIR
Expand Down
16 changes: 15 additions & 1 deletion Odin.sln
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.Odin.System", "System
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Odin.DesignContracts.Analyzers", "DesignContracts\Analyzers\Odin.DesignContracts.Analyzers.csproj", "{12C40512-CA83-4209-9318-6CBCABF8C798}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Odin.Patterns.CommandHandler", "Patterns\CommandHandler\Odin.Patterns.CommandHandler.csproj", "{382C1CC0-F981-4682-9EFD-4471955327C3}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Odin.Patterns.Commands", "Patterns\Commands\Odin.Patterns.Commands.csproj", "{382C1CC0-F981-4682-9EFD-4471955327C3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Patterns", "Patterns", "{605A7674-8EA4-458D-9FEB-A86C927AC0F0}"
EndProject
Expand All @@ -110,6 +110,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Odin.Domain", "Domain\Core\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Odin.Domain.EntityFramework", "Domain\EntityFramework\Odin.Domain.EntityFramework.csproj", "{F0C4BEDA-4B20-4EC8-8265-EFF66D2B1B15}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Odin.Patterns.Notifications", "Patterns\Notifications\Odin.Patterns.Notifications.csproj", "{36D412FB-8A69-47A4-BABF-7B851603C9A1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Odin.Patterns.Queries", "Patterns\Queries\Odin.Patterns.Queries.csproj", "{FA79B472-DEDA-4BEE-B151-2B553A6528C2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -248,6 +252,14 @@ Global
{F0C4BEDA-4B20-4EC8-8265-EFF66D2B1B15}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0C4BEDA-4B20-4EC8-8265-EFF66D2B1B15}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0C4BEDA-4B20-4EC8-8265-EFF66D2B1B15}.Release|Any CPU.Build.0 = Release|Any CPU
{36D412FB-8A69-47A4-BABF-7B851603C9A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36D412FB-8A69-47A4-BABF-7B851603C9A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36D412FB-8A69-47A4-BABF-7B851603C9A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36D412FB-8A69-47A4-BABF-7B851603C9A1}.Release|Any CPU.Build.0 = Release|Any CPU
{FA79B472-DEDA-4BEE-B151-2B553A6528C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA79B472-DEDA-4BEE-B151-2B553A6528C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA79B472-DEDA-4BEE-B151-2B553A6528C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA79B472-DEDA-4BEE-B151-2B553A6528C2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{CE323D9C-635B-EFD3-5B3F-7CE371D8A86A} = {BF440C74-E223-3CBF-8FA7-83F7D164F7C3}
Expand Down Expand Up @@ -283,5 +295,7 @@ Global
{382C1CC0-F981-4682-9EFD-4471955327C3} = {605A7674-8EA4-458D-9FEB-A86C927AC0F0}
{9EF181C9-41C7-4C02-97AB-AD0D1DDFA323} = {5B5DADD3-07F8-40E9-949A-82BEB18093CC}
{F0C4BEDA-4B20-4EC8-8265-EFF66D2B1B15} = {5B5DADD3-07F8-40E9-949A-82BEB18093CC}
{36D412FB-8A69-47A4-BABF-7B851603C9A1} = {605A7674-8EA4-458D-9FEB-A86C927AC0F0}
{FA79B472-DEDA-4BEE-B151-2B553A6528C2} = {605A7674-8EA4-458D-9FEB-A86C927AC0F0}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Odin.Patterns.CommandHandler;
namespace Odin.Patterns.Commands;

/// <summary>
/// Generic treatment of ICommandHandler for use in testing and other scenarios.
Expand Down
16 changes: 16 additions & 0 deletions Patterns/Commands/ICommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Odin.Patterns.Commands;

/// <summary>
/// Defines a command request that returns an operation result
/// (e.g., a new ID, a Result class, etc.)
/// or could be a query that returns query results data.
/// </summary>
/// <typeparam name="TResult"></typeparam>
public interface ICommand<out TResult> { }

/// <summary>
/// Defines a command request that doesn't return a value
/// </summary>
public interface ICommand
{
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
namespace Odin.Patterns.CommandHandler;

/// <summary>
/// Defines a command request that doesn't return a value
/// </summary>
public interface ICommand { }

/// <summary>
/// Defines a command request that returns an operation result
/// (e.g., a new ID, a Result class, etc.)
/// or could be a query that returns query results data.
/// </summary>
/// <typeparam name="TResult"></typeparam>
public interface ICommand<out TResult> { }
namespace Odin.Patterns.Commands;

/// <summary>
/// Defines the handling implementation for a command request that does not return a Result.
Expand All @@ -33,15 +20,15 @@ public interface ICommandHandler<in TCommand>
/// Defines the handling implementation for a command request that returns a Result.
/// </summary>
/// <typeparam name="TCommand"></typeparam>
/// <typeparam name="TResult"></typeparam>
public interface ICommandHandler<in TCommand, TResult>
where TCommand : ICommand<TResult>
/// <typeparam name="TCommandResult"></typeparam>
public interface ICommandHandler<in TCommand, TCommandResult>
where TCommand : ICommand<TCommandResult>
{
/// <summary>
/// Handles the command request and returns a result.
/// </summary>
/// <param name="command"></param>
/// <param name="ct"></param>
/// <returns></returns>
Task<TResult> HandleAsync(TCommand command, CancellationToken ct = default);
Task<TCommandResult> HandleAsync(TCommand command, CancellationToken ct = default);
}
8 changes: 8 additions & 0 deletions Patterns/Notifications/INotification.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Odin.Patterns.Notifications;

/// <summary>
/// Defines a notification request.
/// </summary>
public interface INotification
{
}
17 changes: 17 additions & 0 deletions Patterns/Notifications/INotificationHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace Odin.Patterns.Notifications;

/// <summary>
/// Defines the publishing implementation for a notification request.
/// </summary>
/// <typeparam name="TNotification"></typeparam>
public interface INotificationHandler<in TNotification>
where TNotification : INotification
{
/// <summary>
/// Handles the command request
/// </summary>
/// <param name="command"></param>
/// <param name="ct"></param>
/// <returns></returns>
Task HandleAsync(TNotification command, CancellationToken ct = default);
}
18 changes: 18 additions & 0 deletions Patterns/Notifications/Odin.Patterns.Notifications.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<ImplicitUsings>true</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Description>

</Description>
<WarningsAsErrors>1591;1573;</WarningsAsErrors> <!-- Not to be removed. Documentation is required. -->
</PropertyGroup>

<ItemGroup>
<None Include="../../Assets/icon.png" Pack="true" PackagePath=""/>
<None Include="..\README.md" Pack="true" PackagePath=""/>
</ItemGroup>
</Project>
9 changes: 9 additions & 0 deletions Patterns/Queries/IQuery.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Odin.Patterns.Queries;

/// <summary>
/// Defines a query request that returns
/// one or other for of data or a result.
/// </summary>
/// <typeparam name="TResult"></typeparam>
public interface IQuery<out TResult> { }

18 changes: 18 additions & 0 deletions Patterns/Queries/IQueryHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace Odin.Patterns.Queries;

/// <summary>
/// Defines the handling implementation for a command request that returns a Result.
/// </summary>
/// <typeparam name="TQuery"></typeparam>
/// <typeparam name="TQueryResult"></typeparam>
public interface IQueryHandler<in TQuery, TQueryResult>
where TQuery : IQuery<TQueryResult>
{
/// <summary>
/// Handles the query request and returns a result.
/// </summary>
/// <param name="query"></param>
/// <param name="ct"></param>
/// <returns></returns>
Task<TQueryResult> HandleAsync(TQuery query, CancellationToken ct = default);
}
18 changes: 18 additions & 0 deletions Patterns/Queries/Odin.Patterns.Queries.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<ImplicitUsings>true</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Description>

</Description>
<WarningsAsErrors>1591;1573;</WarningsAsErrors> <!-- Not to be removed. Documentation is required. -->
</PropertyGroup>

<ItemGroup>
<None Include="../../Assets/icon.png" Pack="true" PackagePath=""/>
<None Include="..\README.md" Pack="true" PackagePath=""/>
</ItemGroup>
</Project>
Loading