Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Update CommandResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
lucabriguglia committed Feb 18, 2020
1 parent 4050310 commit d140857
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 18 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,43 @@ With Kledex you can automatically dispatch events to a message bus (Service Bus

| Package | Latest Stable |
| --- | --- |
| [Kledex](https://www.nuget.org/packages/Kledex) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.0-blue.svg)](https://www.nuget.org/packages/Kledex) |
| [Kledex](https://www.nuget.org/packages/Kledex) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.1-blue.svg)](https://www.nuget.org/packages/Kledex) |

### Store Providers

| Package | Latest Stable |
| --- | --- |
| [Kledex.Store.Cosmos.Mongo](https://www.nuget.org/packages/Kledex.Store.Cosmos.Mongo) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.0-blue.svg)](https://www.nuget.org/packages/Kledex.Store.Cosmos.Mongo) |
| [Kledex.Store.Cosmos.Sql](https://www.nuget.org/packages/Kledex.Store.Cosmos.Sql) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.0-blue.svg)](https://www.nuget.org/packages/Kledex.Store.Cosmos.Sql) |
| [Kledex.Store.EF.MySql](https://www.nuget.org/packages/Kledex.Store.EF.MySql) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.0-blue.svg)](https://www.nuget.org/packages/Kledex.Store.EF.MySql) |
| [Kledex.Store.EF.PostgreSql](https://www.nuget.org/packages/Kledex.Store.EF.PostgreSql) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.0-blue.svg)](https://www.nuget.org/packages/Kledex.Store.EF.PostgreSql) |
| [Kledex.Store.EF.Sqlite](https://www.nuget.org/packages/Kledex.Store.EF.Sqlite) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.0-blue.svg)](https://www.nuget.org/packages/Kledex.Store.EF.Sqlite) |
| [Kledex.Store.EF.SqlServer](https://www.nuget.org/packages/Kledex.Store.EF.SqlServer) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.0-blue.svg)](https://www.nuget.org/packages/Kledex.Store.EF.SqlServer) |
| [Kledex.Store.EF.InMemory](https://www.nuget.org/packages/Kledex.Store.EF.InMemory) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.0-blue.svg)](https://www.nuget.org/packages/Kledex.Store.EF.InMemory) |
| [Kledex.Store.EF.Cosmos](https://www.nuget.org/packages/Kledex.Store.EF.Cosmos) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.0-blue.svg)](https://www.nuget.org/packages/Kledex.Store.EF.Cosmos) |
| [Kledex.Store.Cosmos.Mongo](https://www.nuget.org/packages/Kledex.Store.Cosmos.Mongo) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.1-blue.svg)](https://www.nuget.org/packages/Kledex.Store.Cosmos.Mongo) |
| [Kledex.Store.Cosmos.Sql](https://www.nuget.org/packages/Kledex.Store.Cosmos.Sql) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.1-blue.svg)](https://www.nuget.org/packages/Kledex.Store.Cosmos.Sql) |
| [Kledex.Store.EF.MySql](https://www.nuget.org/packages/Kledex.Store.EF.MySql) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.1-blue.svg)](https://www.nuget.org/packages/Kledex.Store.EF.MySql) |
| [Kledex.Store.EF.PostgreSql](https://www.nuget.org/packages/Kledex.Store.EF.PostgreSql) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.1-blue.svg)](https://www.nuget.org/packages/Kledex.Store.EF.PostgreSql) |
| [Kledex.Store.EF.Sqlite](https://www.nuget.org/packages/Kledex.Store.EF.Sqlite) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.1-blue.svg)](https://www.nuget.org/packages/Kledex.Store.EF.Sqlite) |
| [Kledex.Store.EF.SqlServer](https://www.nuget.org/packages/Kledex.Store.EF.SqlServer) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.1-blue.svg)](https://www.nuget.org/packages/Kledex.Store.EF.SqlServer) |
| [Kledex.Store.EF.InMemory](https://www.nuget.org/packages/Kledex.Store.EF.InMemory) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.1-blue.svg)](https://www.nuget.org/packages/Kledex.Store.EF.InMemory) |
| [Kledex.Store.EF.Cosmos](https://www.nuget.org/packages/Kledex.Store.EF.Cosmos) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.1-blue.svg)](https://www.nuget.org/packages/Kledex.Store.EF.Cosmos) |

### Bus Providers

| Package | Latest Stable |
| --- | --- |
| [Kledex.Bus.ServiceBus](https://www.nuget.org/packages/Kledex.Bus.ServiceBus) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.0-blue.svg)](https://www.nuget.org/packages/Kledex.Bus.ServiceBus) |
| [Kledex.Bus.RabbitMQ](https://www.nuget.org/packages/Kledex.Bus.RabbitMQ) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.0-blue.svg)](https://www.nuget.org/packages/Kledex.Bus.RabbitMQ) |
| [Kledex.Bus.ServiceBus](https://www.nuget.org/packages/Kledex.Bus.ServiceBus) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.1-blue.svg)](https://www.nuget.org/packages/Kledex.Bus.ServiceBus) |
| [Kledex.Bus.RabbitMQ](https://www.nuget.org/packages/Kledex.Bus.RabbitMQ) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.1-blue.svg)](https://www.nuget.org/packages/Kledex.Bus.RabbitMQ) |

### Validation Providers

| Package | Latest Stable |
| --- | --- |
| [Kledex.Validation.FluentValidation](https://www.nuget.org/packages/Kledex.Validation.FluentValidation) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.0-blue.svg)](https://www.nuget.org/packages/Kledex.Validation.FluentValidation) |
| [Kledex.Validation.FluentValidation](https://www.nuget.org/packages/Kledex.Validation.FluentValidation) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.1-blue.svg)](https://www.nuget.org/packages/Kledex.Validation.FluentValidation) |

### Caching Providers

| Package | Latest Stable |
| --- | --- |
| [Kledex.Caching.Memory](https://www.nuget.org/packages/Kledex.Caching.Memory) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.0-blue.svg)](https://www.nuget.org/packages/Kledex.Caching.Memory) |
| [Kledex.Caching.Redis](https://www.nuget.org/packages/Kledex.Caching.Redis) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.0-blue.svg)](https://www.nuget.org/packages/Kledex.Caching.Redis) |
| [Kledex.Caching.Memory](https://www.nuget.org/packages/Kledex.Caching.Memory) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.1-blue.svg)](https://www.nuget.org/packages/Kledex.Caching.Memory) |
| [Kledex.Caching.Redis](https://www.nuget.org/packages/Kledex.Caching.Redis) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.1-blue.svg)](https://www.nuget.org/packages/Kledex.Caching.Redis) |

### Misc

| Package | Latest Stable |
| --- | --- |
| [Kledex.UI](https://www.nuget.org/packages/Kledex.UI) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.0-blue.svg)](https://www.nuget.org/packages/Kledex.UI) |
| [Kledex.UI](https://www.nuget.org/packages/Kledex.UI) | [![Nuget Package](https://img.shields.io/badge/nuget-2.5.1-blue.svg)](https://www.nuget.org/packages/Kledex.UI) |
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\Directory.Build.props" Condition="Exists('..\Directory.Build.props')" />

<PropertyGroup Label="NugetSettings">
<Version>2.5.0</Version>
<Version>2.5.1</Version>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild Condition="$(Configuration) == 'Release'">true</GeneratePackageOnBuild>
<PackageTags>Kledex, OpenCQRS, .net, core, mediator, ddd, cqrs, event sourcing, clean design, clean code, commands, queries, events</PackageTags>
Expand Down
14 changes: 14 additions & 0 deletions src/Kledex/Commands/CommandResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,19 @@ public class CommandResponse
{
public IEnumerable<IEvent> Events { get; set; } = new List<IEvent>();
public object Result { get; set; }

public CommandResponse()
{
}

public CommandResponse(IEvent @event, object result = null)
{
Events = new List<IEvent>
{
@event
};

Result = result;
}
}
}
4 changes: 2 additions & 2 deletions src/Kledex/Commands/CommandSenderAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public async Task<TResult> SendAsync<TResult>(ICommand command, Func<Task<Comman
/// <inheritdoc />
public async Task<TResult> SendAsync<TResult>(ICommandSequence commandSequence)
{
var lastStepReponse = await ProcessCommandSequenceAsync(commandSequence);
return lastStepReponse?.Result != null ? (TResult)lastStepReponse.Result : default;
var lastStepResponse = await ProcessCommandSequenceAsync(commandSequence);
return lastStepResponse?.Result != null ? (TResult)lastStepResponse.Result : default;
}

private async Task<CommandResponse> ProcessCommandSequenceAsync(ICommandSequence commandSequence)
Expand Down

0 comments on commit d140857

Please sign in to comment.