Last active
July 9, 2020 20:38
-
-
Save ankitvijay/2d58f5cefba20f4fa202bbd96c9133cd to your computer and use it in GitHub Desktop.
Part 4 - TransactionController
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
public class Transaction | |
{ | |
public PaymentType PaymentType { get; set; } | |
public decimal Amount { get; set; } | |
} |
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
[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