public Order CreateNewOrder(CustomerIdentity customerId, IEnumerable <OrderItem> orderDetails) { var id = _orderIdentityGenerator.Next(); var orderDate = _timeService.Now; return(new Order(id, customerId, orderDate, OrderStatus.New, orderDetails)); }
private void Save(IReadOnlyCollection <PerformedOperationFinalProcessing> transportMessages) { foreach (var transportMessage in transportMessages) { transportMessage.Id = _identityGenerator.Next(); } _repository.AddRange(transportMessages); _repository.Save(); }
private void Save(IReadOnlyCollection <PerformedOperationFinalProcessing> transportMessages, Guid targetFlowId) { foreach (var transportMessage in transportMessages) { transportMessage.Id = _identityGenerator.Next(); transportMessage.CreatedOn = DateTime.UtcNow; transportMessage.MessageFlowId = targetFlowId; } _repository.AddRange(transportMessages); _repository.Save(); }
public OrderItem CreateNewOrderItem(Product product, decimal quantity) { if (product == null) { throw new ArgumentException(); } if (quantity < 0) { throw new ArgumentException(); } var id = _orderItemIdentityGenerator.Next(); return(new OrderItem(id, product.Id, quantity, product.ListPrice, OrderItemStatus.Allocated)); }
public Customer Create(string firstName, string lastName) { var id = _customerIdentityGenerator.Next(); return(new Customer(id, firstName, lastName)); }
public Product CreateNewProduct(string productCode, string productName, decimal listPrice) { var id = _productIdentityGenerator.Next(); return(new Product(id, productCode, productName, listPrice, DefaultIsListed)); }
public Document Create(string title, string content) { var id = _bookIdentityGenerator.Next(); return(new Document(id, title, content)); }