Skip to content

Instantly share code, notes, and snippets.

@ankitvijay
Last active July 9, 2020 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankitvijay/2d58f5cefba20f4fa202bbd96c9133cd to your computer and use it in GitHub Desktop.
Save ankitvijay/2d58f5cefba20f4fa202bbd96c9133cd to your computer and use it in GitHub Desktop.
Part 4 - TransactionController
public class Transaction
{
public PaymentType PaymentType { get; set; }
public decimal Amount { get; set; }
}
[ApiController]
[Route("[controller]")]
public class TransactionController : ControllerBase
{
private static readonly List<Transaction> s_Transactions = new List<Transaction>();
[HttpPost]
[Route("create")]
public IActionResult CreateTransaction(Transaction transaction)
{
s_Transactions.Add(transaction);
return Ok();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment