public BuyCommand(IReadOnlyCollection<Coin> deposit, GoodsIdentity goods) { Contract.Requires(deposit != null); Contract.Requires(!goods.Equals(default(GoodsIdentity))); Deposit = deposit; Goods = goods; }
public BuyCommand(IReadOnlyCollection <Coin> deposit, GoodsIdentity goods) { Contract.Requires(deposit != null); Contract.Requires(!goods.Equals(default(GoodsIdentity))); Deposit = deposit; Goods = goods; }
public JsonResult Buy(IEnumerable<CoinViewModel> deposit, Guid goodsIdentity) { Contract.Requires(deposit != null); Contract.Requires(goodsIdentity != default(Guid)); var depositCoins = deposit .Select(x => new Coin(x.ParValue, x.Count)) .ToArray(); var goods = new GoodsIdentity(goodsIdentity); Contract.Assume(!goods.Equals(default(GoodsIdentity))); var command = new BuyCommand(depositCoins, goods); var @event = _buyCommandHandler.Execute(command); return Json(@event); }
public JsonResult Buy(IEnumerable <CoinViewModel> deposit, Guid goodsIdentity) { Contract.Requires(deposit != null); Contract.Requires(goodsIdentity != default(Guid)); var depositCoins = deposit .Select(x => new Coin(x.ParValue, x.Count)) .ToArray(); var goods = new GoodsIdentity(goodsIdentity); Contract.Assume(!goods.Equals(default(GoodsIdentity))); var command = new BuyCommand(depositCoins, goods); var @event = _buyCommandHandler.Execute(command); return(Json(@event)); }