public static Operations.DataStructures.Delivery ToServiceContract(IDocumentStore documentStore, Entities.Delivery deliveryEntity) { if (documentStore == null) { throw new ArgumentNullException(nameof(documentStore)); } if (deliveryEntity == null) { return(null); } var id = DocumentIdHelper.GetEntityId <Entities.Delivery>(documentStore, deliveryEntity.Id); return(new Operations.DataStructures.Delivery( id, AddressMapper.ToServiceContract(deliveryEntity.Address), DeliveryStatusMapper.ToServiceContract(deliveryEntity.Status))); }
public static CreateDeliveryRequestCommand ToServiceCommand(string transactionId, Contracts.DataStructures.Address address) { return(new CreateDeliveryRequestCommand(transactionId, AddressMapper.ToServiceContract(address))); }