Esempio n. 1
0
        /// <summary>
        /// Return a list of Sample addresses using LINQ to SQL
        /// </summary>
        /// <returns></returns>
        public List<sp_Vendor_DM> ListVendors()
        {
            List<sp_Vendor_DM> list = new List<sp_Vendor_DM>();
            try
            {
                using (VolTeerEntities context = new VolTeerEntities())
                {
                    list = (from result in context.sp_Vendor_Select(null)
                            select new sp_Vendor_DM
                            {
                                ActiveFlg = result.ActiveFlg,
                                VendorID = result.VendorID,
                                VendorName = result.VendorName

                            }).ToList();
                } // Guaranteed to close the Connection
            }
            catch (Exception ex)
            {
                throw (ex);
            }

            return list;
        }