Exemplo n.º 1
0
        public List<sp_ProjectEvent_DM> ListEvents(Guid? EventID)
        {
            List<sp_ProjectEvent_DM> list = new List<sp_ProjectEvent_DM>();
            try
            {
                using (VolTeerEntities context = new VolTeerEntities())
                {
                    list = (from result in context.sp_ProjectEvent_Select(EventID)
                            select new sp_ProjectEvent_DM
                            {
                                EventID = result.EventID,
                                ProjectID = result.ProjectID,
                                StartDateTime = result.StartDateTime,
                                EndDateTime = result.EndDateTime,
                                AddrID = result.AddrID
                            }).ToList();
                } // Guaranteed to close the Connection
            }
            catch (Exception ex)
            {
                throw (ex);
            }

            return list;
        }