/// <summary> /// Gets orders by customer id /// </summary> /// <param name="customerId"></param> /// <returns></returns> public List <Order> GetOrderByCustomerId(int customerId) { List <Order> ordersForCustomer = new List <Order>(); foreach (var item in repo.GetOrderByCustomerId(customerId)) { if (item.CustomerId == customerId) { ordersForCustomer.Add(item); } } return(ordersForCustomer); }
/// <summary> /// Gets orders by customer id /// </summary> /// <param name="customerId"></param> /// <returns></returns> public List <Order> GetOrderByCustomerId(string email) { var customer = GetCustomerByEmail(email); List <Order> ordersForCustomer = new List <Order>(); foreach (var item in repo.GetOrderByCustomerId(customer.Id)) { if (item.CustomerId == customer.Id) { ordersForCustomer.Add(item); } } return(ordersForCustomer); }