Ejemplo n.º 1
0
        public IEnumerable <Order> GetOrdersByEmail(string email)
        {
            OrderData data = new OrderData();

            string sanitizedEmail = email.Replace("-", ".");        //Convert from url-friendly email back to correct format
            var    orders         = data.GetOrdersByEmail(sanitizedEmail);

            try {               //Catch exceptions thrown by null User
                if (orders[0] == null)
                {
                    return(new List <Order>());
                }
            } catch (ArgumentOutOfRangeException e) {
                Debug.WriteLine(e.Message);
                return(new List <Order>());
            } catch (Exception e) {
                Debug.WriteLine(e.Message);
                return(new List <Order>());
            }
            return(orders);
        }