public async Task <IActionResult> PostTransactions(string accountId, [FromQuery] TransactionSource transactionSource) { var bytes = new byte[HttpContext.Request.ContentLength.Value]; using (var ms = new MemoryStream(bytes.Length)) { await HttpContext.Request.Body.CopyToAsync(ms); ms.Seek(0, SeekOrigin.Begin); using (var sr = new StreamReader(ms)) { switch (transactionSource) { case TransactionSource.Hac: await _accountHandler.ProcessHacTransactions(accountId, await sr.ReadToEndAsync()); break; case TransactionSource.OtpBank: await _accountHandler.ProcessOtpBankTransactions(accountId, await sr.ReadToEndAsync()); break; case TransactionSource.Revolut: await _accountHandler.ProcessRevolutTransactions(accountId, await sr.ReadToEndAsync()); break; default: throw new System.Exception(); } } } return(Ok()); }