public CxMeetingModel(CxMeeting dbMeeting) { this.Id = dbMeeting.Id; this.Title = dbMeeting.Title; this.Description = dbMeeting.Description; this.StartTime = dbMeeting.StartTime; this.Duration = dbMeeting.Duration; this.OwnerId = dbMeeting.OwnerId; this.SessionId = dbMeeting.SessionId; this.IsPublic = dbMeeting.IsPublic; this.IsArchived = dbMeeting.IsArchived; this.Attendees = dbMeeting.Attendees .Select(a => new CxMeetingAttendeeModel(a)).ToList(); this.AttendeeRequests = dbMeeting.AttendeeRequests.Select(a => new CxMeetingAttendeeRequestModel(a)).ToList(); }
private static bool IsAllowedToSeeMeeting(CxMeeting meeting, string userId) { return(meeting.OwnerId == userId || meeting.Attendees.Any(a => a.UserId == userId) || meeting.IsPublic); }