Ejemplo n.º 1
0
        /// <summary>
        /// Lists the Customers table.
        /// </summary>
        /// <returns>The list of Customers or null.</returns>
        public EF_PoC_Customer.Customers ListCustomer()
        {
            try
            {
                // Turn off proxy creation.
                customerContext.Configuration.ProxyCreationEnabled = false;

                // List table.
                EF_PoC_Customer.Customers retVal = new EF_PoC_Customer.Customers();
                foreach (var oneItem in customerContext.Customers.ToList())
                {
                    retVal.Items.Add(oneItem);
                }

                return(retVal);
            }
            catch
            {
                return(null);
            }
        }
        /// <summary>
        /// Lists the Customers table.
        /// </summary>
        /// <returns>The list of Customers or null.</returns>
        public EF_PoC_Customer.Customers ListCustomer()
        {
            try
            {
                // Turn off proxy creation.
                customerContext.Configuration.ProxyCreationEnabled = false;

                // List table.
                EF_PoC_Customer.Customers retVal = new EF_PoC_Customer.Customers();
                foreach (var oneItem in customerContext.Customers.ToList())
                {
                    retVal.Items.Add(oneItem);
                }

                return retVal;
            }
            catch
            {
                return null;
            }
        }