public static Inventory Create(CreateInventory cmd) { var inventory = new Inventory(cmd.Id, cmd.Qty, cmd.Item, cmd.Constraints); InventoryPolicy.Verify(inventory); inventory.ApplyEvent(new InventoryCreated(inventory.Id, inventory.Qty, inventory.Item, inventory.constraints)); return(inventory); }
public static InventoryPolicy CreateInventoryPolicy(string dataAreaId, string policyId, global::Microsoft.Dynamics.DataEntities.CostFlowAssumptionPolicy costFlowAssumptionPolicy) { InventoryPolicy inventoryPolicy = new InventoryPolicy(); inventoryPolicy.dataAreaId = dataAreaId; inventoryPolicy.PolicyId = policyId; if ((costFlowAssumptionPolicy == null)) { throw new global::System.ArgumentNullException("costFlowAssumptionPolicy"); } inventoryPolicy.CostFlowAssumptionPolicy = costFlowAssumptionPolicy; return(inventoryPolicy); }