public void Execute(UpdateLotInstrumentPriceCommand command) { if (command == null) { throw new ArgumentNullException(nameof(command)); } var lot = _lotRepository.GetById(command.LotId); if (lot == null) { throw new InvalidOperationException($"Cannot find lot with id `{command.LotId}`."); } var instrument = _instrumentRepository.GetById(lot.InstrumentInfo.Symbol); if (instrument == null) { throw new InvalidOperationException($"Cannot find instrument with symbol `{lot.InstrumentInfo.Symbol}`."); } lot.UpdateInstrumentPrice(instrument.CurrentPrice); _lotRepository.Update(lot); }
public LotEntity GetLotEntity(int id) { try { return(_lotRepository.GetById(id).ToLotEntity()); } catch (Exception exception) { Log.LogError(exception); return(null); } }
public LotDto GetItem(int id) { return(_lotRepository.GetById(id)?.ToDto()); }
public void When(LotWasCreatedDomainEvent domainEvent) { var createdLot = _lotRepository.GetById(domainEvent.LotId); StartTrackingInstrumentForLot(createdLot); }
public Lot GetLot(int id) { return(lotRepository.GetById(id)); }
public LotEntity GetLotEntity(int id) { return(_lotRepository.GetById(id)?.ToBllLotEntity()); }