private void CreateSalesOrder(CreateSalesOrder createSalesOrder) { logger.Info("Create purchase order (Id: {0})", createSalesOrder.Id); var salesOrderCreated = new SalesOrderCreated(createSalesOrder.Id, createSalesOrder.Number); Persist(salesOrderCreated, @event => { this.SalesOrderCreated(@event); SaveSnapshot(); // Sender.Tell(SalesOrderCreated); }); }
private void CreateSalesOrder(CreateSalesOrder createSalesOrder) { logger.Info("Create purchase order (Number: {0})", createSalesOrder.Number); string id = string.Empty; IActorRef SalesOrderActor = Context.ActorOf(Context.DI().Props <SalesOrderActor>(), $"sales-order-{ id }"); // locks.Add(SalesOrderActor, new Lock(createSalesOrder.SessionActor, DateTime.Now)); SalesOrderActor.Forward(createSalesOrder); var salesOrderCreated = new SalesOrderCreated(id, createSalesOrder.Number); Sender.Tell(salesOrderCreated); }