Preperation for savig account data

This commit is contained in:
Mikhail Shabanov committed 2020-10-25 19:05:08 +01:00
1 parent 5e0369511f
commit 91f69a6e39
5 files changed
+75 -14

No files matched your search

@@ -6,5 +6,7 @@ namespace WotBlitzStatisticsPro.Logic
public interface IWargamingAccounts
{
Task<AccountInfoResponse> GatherAccountInformation(RealmType realm, long accountId, RequestLanguage requestLanguage);
Task<AccountInfoResponse> GatherAndSaveAccountInformation(RealmType realm, long accountId, RequestLanguage requestLanguage);
}
}
@@ -25,13 +25,30 @@ namespace WotBlitzStatisticsPro.Logic
.AddOperation<CalculateStatisticsOperation>()
.AddOperation<BuildAccountInfoResponseOperation>()
;
// ToDo: add other operations
await pipeline.Build()
.Invoke(context, null)
.ConfigureAwait(false);
// ToDo: return context response
return context.Response;
}
public async Task<AccountInfoResponse> GatherAndSaveAccountInformation(RealmType realm, long accountId, RequestLanguage requestLanguage)
{
var context = new AccountInformationPipelineContext(accountId, realm, requestLanguage);
var pipeline = new Pipeline<AccountInformationPipelineContext>(_operationFactory);
pipeline.AddOperation<GetAccountInfoOperation>()
// ToDo: add operation for reading AccountFrom DB
.AddOperation<GetTanksInfoOperation>()
.AddOperation<CalculateStatisticsOperation>()
// ToDo: add operation for save info into DB
.AddOperation<BuildAccountInfoResponseOperation>()
;
await pipeline.Build()
.Invoke(context, null)
.ConfigureAwait(false);
return context.Response;
}