mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-23 19:30:06 +02:00
Operations pipeline start
This commit is contained in:
1 parent
6c10c6c654
commit
7ffbeb6b17
19 files changed
+432
-5
No files matched your search
@@ -0,0 +1,37 @@
|
||||
using System.Threading.Tasks;
|
||||
using WotBlitzStatisticsPro.Common.Model;
|
||||
using WotBlitzStatisticsPro.Logic.AccountInformationPipeline;
|
||||
using WotBlitzStatisticsPro.Logic.AccountInformationPipeline.Operations;
|
||||
using WotBlitzStatisticsPro.Logic.Pipeline;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Logic
|
||||
{
|
||||
public class WargamingAccounts: IWargamingAccounts
|
||||
{
|
||||
private readonly IOperationFactory _operationFactory;
|
||||
|
||||
public WargamingAccounts(IOperationFactory operationFactory)
|
||||
{
|
||||
_operationFactory = operationFactory;
|
||||
}
|
||||
|
||||
public async Task<bool> GatherAccountInformation(RealmType realm, long accountId, RequestLanguage requestLanguage)
|
||||
{
|
||||
var context = new AccountInformationPipelineContext(accountId, realm, requestLanguage);
|
||||
var pipeline = new Pipeline<AccountInformationPipelineContext>(_operationFactory);
|
||||
|
||||
pipeline.AddOperation<GetAccountInfoOperation>()
|
||||
.AddOperation<GetTanksInfoOperation>()
|
||||
;
|
||||
// ToDo: add other operations
|
||||
|
||||
await pipeline.Build()
|
||||
.Invoke(context, null)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
// ToDo: return context response
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user