public async Task ApplyAsync(PurchaseOrder order) { var mermberships = order.Items.Where(i => i.Type == ItemType.Membership); foreach (var mermbership in mermberships) { await _customerAccountService.ActivateMembership(order.CustomerId, mermbership.Id); } }
public void Apply(PurchaseOrder purchaseOrder) { if (purchaseOrder.Items.Any(x => x.Type == ItemType.Membership)) { foreach (var item in purchaseOrder.Items) { _customerAccountService.ActivateMembership(purchaseOrder.CustomerId, item.Id); } } }