-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1344d84
commit be56169
Showing
18 changed files
with
189 additions
and
130 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
11 changes: 11 additions & 0 deletions
11
Examples/Caching/Examples.Caching.MemoryCaching/ITestApplicationService.cs
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,11 @@ | ||
| ||
namespace Examples.Caching.MemoryCaching | ||
{ | ||
public interface ITestApplicationService | ||
{ | ||
TestDto GetDistributedMemoryCache(string key); | ||
TestDto GetMemoryCache(string key); | ||
void SetDistributedMemoryCache(string key, Type type, object data); | ||
void SetMemoryCache(string key, TestDto data); | ||
} | ||
} |
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
25 changes: 6 additions & 19 deletions
25
Examples/Caching/Examples.Caching.PersistenceCaching/TestApplicationService.cs
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,33 +1,20 @@ | ||
using RCommon.ApplicationServices.Commands; | ||
using RCommon.ApplicationServices.ExecutionResults; | ||
using RCommon.ApplicationServices.Queries; | ||
using System; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Examples.Caching.PersistenceCaching | ||
{ | ||
public class TestApplicationService : ITestApplicationService | ||
public class TestApplicationService | ||
{ | ||
private readonly ICommandBus _commandBus; | ||
private readonly IQueryBus _queryBus; | ||
|
||
|
||
public TestApplicationService(ICommandBus commandBus, IQueryBus queryBus) | ||
public TestApplicationService() | ||
{ | ||
_commandBus = commandBus; | ||
_queryBus = queryBus; | ||
|
||
} | ||
|
||
public async Task<TestDto> ExecuteTestQuery(TestQuery query) | ||
{ | ||
return await _queryBus.DispatchQueryAsync(query, CancellationToken.None); | ||
} | ||
|
||
public async Task<IExecutionResult> ExecuteTestCommand(TestCommand command) | ||
{ | ||
return await _commandBus.DispatchCommandAsync(command, CancellationToken.None); | ||
} | ||
|
||
} | ||
} |
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
9 changes: 9 additions & 0 deletions
9
Examples/Caching/Examples.Caching.RedisCaching/ITestApplicationService.cs
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,9 @@ | ||
| ||
namespace Examples.Caching.RedisCaching | ||
{ | ||
public interface ITestApplicationService | ||
{ | ||
TestDto GetDistributedMemoryCache(string key); | ||
void SetDistributedMemoryCache(string key, Type type, object data); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Examples.Caching.RedisCaching | ||
{ | ||
public record TestDto | ||
{ | ||
public TestDto(string message) | ||
{ | ||
Message = message; | ||
} | ||
|
||
public string Message { get; } | ||
} | ||
} |
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
Oops, something went wrong.