public async Task <CommandHandlingResult> Handle(Services.Commands.CreateAssetPairCommand command, IEventPublisher eventPublisher) { await _assetPairRepository.UpsertAsync(command.AssetPair); _chaosKitty.Meow("repository unavailable"); eventPublisher.PublishEvent(Mapper.Map <AssetPairCreatedEvent>(command.AssetPair)); return(CommandHandlingResult.Ok()); }
public async Task <IAssetPair> AddAsync(IAssetPair assetPair) { await _assetPairRepository.UpsertAsync(assetPair); await _myNoSqlWriter.TryInsertOrReplaceAsync(AssetPairNoSql.Create(assetPair)); //todo: remove cqrs _cqrsEngine.SendCommand( new CreateAssetPairCommand { AssetPair = Mapper.Map <AssetPair>(assetPair) }, BoundedContext.Name, BoundedContext.Name); return(assetPair); }