Exemplo n.º 1
0
        private List <EventRequest> GetMyEvents(UserInfo user)
        {
            var list = new List <EventRequest>(); // EventRequest.GetAllByUser("SubmittedBy", user.Id).ToList();

            var attendees = Attendee.GetAllByUser("Attendee", user.Id).ToList();

            foreach (Attendee att in attendees)
            {
                if (!list.Any(x => x.Id == att.EventRequestId))
                {
                    // i'm an attendee on an event submitted by someone else, add the event
                    var req = EventRequest.Get(att.EventRequestId);

                    list.Add(req);
                }
            }

            return(list.OrderByDescending(x => x.EventStartDate).ToList());
        }