Example #1
0
        public Trade CreateTrade(Trade trade)
        {
            Guard.AgainstNull(() => trade);

            trade.Validate();

            using (var uow = _uowFactory.Create())
            {
                uow.RepoOf<Trade>().Add(trade);
                uow.SaveChanges();
                return trade;
            }
        }
 private TradeViewModel GetTradeViewModel(Trade trade)
 {
     return new TradeViewModel
     {
         Id = trade.Id,
         IsBuy = trade.IsBuy,
         IsSale = !trade.IsBuy,
         Quantity = trade.Quantity,
         Price = trade.Price,
         Commission = trade.Commission,
         TradeDate = trade.TradeDate
     };
 }
 // TODO: Skal nok have andet navn. Kaldes når ny handel er oprettet og depotet skal opdateres pga. det.
 public DepositInfoDTO Refresh(Deposit deposit, Trade trade)
 {
     deposit.AddTrade(trade);
     return GetDepositInfo(deposit);
 }
Example #4
0
 public void AddTrade(Trade trade)
 {
     Trades.Add(trade);
 }