Пример #1
0
        public async Task <ActionResult> Sell(Sell.Command model)
        {
            model.WithUserId(this.User.Identifier());

            var r = await _mediator.Send(model);

            return(this.OkOrError(r));
        }
Пример #2
0
        public static Sell.Command CreateSellCommand()
        {
            var cmd = new Sell.Command
            {
                Ticker            = Ticker,
                NumberOfContracts = 1,
                Premium           = 10,
                StrikePrice       = 20,
                OptionType        = OptionType.PUT.ToString(),
                ExpirationDate    = DateTimeOffset.UtcNow.AddDays(10),
                Filled            = DateTimeOffset.UtcNow
            };

            cmd.WithUserId(User.Id);

            return(cmd);
        }
Пример #3
0
        public Task <object> Sell(Sell.Command cmd)
        {
            cmd.WithUserId(User.Identifier());

            return(ExecTransaction(cmd));
        }