Esempio n. 1
0
        /// <summary>
        /// Return a list of Sample addresses using LINQ to SQL
        /// </summary>
        /// <returns></returns>
        public List<sp_Volunteer_DM> ListVolunteers()
        {
            List<sp_Volunteer_DM> list = new List<sp_Volunteer_DM>();
            try
            {
                using (VolTeerEntities context = new VolTeerEntities())
                {
                    list = (from result in context.sp_Volunteer_Select(null)
                            select new sp_Volunteer_DM
                            {
                                VolFirstName = result.VolFirstName,
                                VolID = result.VolID,
                                VolMiddleName = result.VolMiddleName,
                                VolLastName = result.VolLastName,
                                ActiveFlg = result.ActiveFlg

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

            return list;
        }