public IHttpActionResult Sell(TransactionDTO transaction) { if (ModelState.IsValid) { return Ok(_stockService.Sell(transaction.Ticker, transaction.Quantity, User.Identity.Name)); } return BadRequest(); }
public IHttpActionResult Buy(TransactionDTO transaction) { if (ModelState.IsValid && _stockService.CheckExists(transaction.Ticker)) { return Ok(_stockService.Buy(transaction.Ticker, transaction.Quantity, User.Identity.Name)); } return BadRequest(); }