public async Task <IActionResult> Put(int id, MeetingParticipants model) { model.Id = id; await _genericRepository.UpdateAsync(model); return(NoContent()); }
public void AssignUserToMeeting(int meetingId, string userId) { MeetingParticipants participant = new MeetingParticipants(); participant.MeetingID = meetingId; participant.UserID = userId; MeetingParticipantsRepository.Add(participant); }
private MeetingParticipants GetMeetingParticipants(IEnumerable <LinkUnfurling.Domain.Entities.ParticipantInfo> participants) { var meetingParticipants = new MeetingParticipants() { Attendees = this.mapper.Map <IEnumerable <MeetingParticipantInfo> >(participants.Where(p => p.Role == ParticipantRole.Attendee)), Organizer = this.mapper.Map <IEnumerable <MeetingParticipantInfo> >(participants.Where(p => p.Role == ParticipantRole.Presenter)).First(), Producers = this.mapper.Map <IEnumerable <MeetingParticipantInfo> >(participants.Where(p => p.Role == ParticipantRole.Producer)), }; return(meetingParticipants); }
public void HandleMeetingAdd(Meeting meeting, int projectId, int?taskId, string userId) { meeting.ProjectID = projectId; meeting.TaskID = taskId; MeetingRepository.Add(meeting); MeetingParticipants participant = new MeetingParticipants(); participant.MeetingID = meeting.ID; participant.UserID = userId; MeetingParticipantsRepository.Add(participant); }
public IHttpActionResult AddNewParticipant(string name, string mail, int meetingid) { Participant part = new Participant(); part.Name = name; part.Email = mail; db.Participants.Add(part); db.SaveChanges(); Participant lastpart = db.Participants.Where(p => p.Email == mail).FirstOrDefault <Participant>();; MeetingParticipants mp = new MeetingParticipants(); mp.IdMeeting = meetingid; mp.IdParticipant = lastpart.Id; db.MeetingParticipants.Add(mp); db.SaveChanges(); return(Ok()); }
public static async Task <IActionResult> Run( [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, ILogger log) { string requestBody = await new StreamReader(req.Body).ReadToEndAsync(); var meeting = JsonConvert.DeserializeObject <Meeting>(requestBody); GraphServiceClient graphClient = GetAuthenticatedGraphClient(); var participants = new MeetingParticipants(); var participantsInfo = new List <MeetingParticipantInfo>(); var participantInfoPacient = new MeetingParticipantInfo(); var identitySetUserPacient = new IdentitySet { User = new Identity() }; var identityUserPacient = new Identity { DisplayName = meeting.PatientEmail }; identitySetUserPacient.User = identityUserPacient; participantInfoPacient.Identity = identitySetUserPacient; /*var participantInfoDoctor = new MeetingParticipantInfo(); * var identitySetUserDoctor = new IdentitySet * { * User = new Identity() * }; * var identityUserDoctor = new Identity * { * DisplayName = meeting.DoctorEmail * }; * identitySetUserDoctor.User = identityUserDoctor; * * participantInfoDoctor.Identity = identitySetUserDoctor; * * participantInfoDoctor.Identity = identitySetUserDoctor;*/ participantsInfo.Add(participantInfoPacient); //participantsInfo.Add(participantInfoDoctor); participants.Attendees = participantsInfo; var onlineMeeting = new OnlineMeeting { StartDateTime = DateTimeOffset.Parse(meeting.StartDate), EndDateTime = DateTimeOffset.Parse(meeting.EndDate), Participants = new MeetingParticipants(), Subject = meeting.Subject }; var onlineMeeting1 = new OnlineMeeting { StartDateTime = DateTimeOffset.Parse("2019-07-12T21:30:34.2444915+00:00"), EndDateTime = DateTimeOffset.Parse("2019-07-12T22:00:34.2464912+00:00"), Subject = "User Token Meeting" }; OnlineMeeting onlineMeetingReturned; try { onlineMeetingReturned = await graphClient.Me.OnlineMeetings.Request().AddAsync(onlineMeeting); }catch (Exception ex) { if (ex.Message.Contains("InvalidAuthenticationToken")) { return(new BadRequestObjectResult("Token Expired")); } else { return(new BadRequestResult()); } } return(new OkObjectResult(onlineMeetingReturned)); }
public static async Task Teams() { try { var publicClientApplication = PublicClientApplicationBuilder .Create("935744b0-3943-4521-8e57-54bcbf493de1") .WithTenantId("5be4ddfe-d46d-4e46-8c80-a26488d9a39c") .WithRedirectUri("http://localhost") .Build(); InteractiveAuthenticationProvider authProvider = new InteractiveAuthenticationProvider(publicClientApplication, new[] { "Directory.ReadWrite.All", "User.Read", "Group.ReadWrite.All", "Team.Create", "OnlineMeetings.ReadWrite" }); GraphServiceClient graphClient = new GraphServiceClient(authProvider); /* var team = new Team * { * DisplayName = "My Sample Team", * Description = "My Sample Team’s Description", * AdditionalData = new Dictionary<string, object>() * { * {"*****@*****.**", "https://graph.microsoft.com/v1.0/teamsTemplates('standard')"}, * * } * };*/ var subject = "Create a meeting with customId provided"; var externalId = "7eb8263f-d0e0-4149-bb1c-1f0476083c56"; var participants = new MeetingParticipants { Attendees = new List <MeetingParticipantInfo>() { new MeetingParticipantInfo { Identity = new IdentitySet { User = new Identity { Id = "e527ded8-6be2-4d76-aca6-579a66ce9ec9" } }, Upn = "*****@*****.**" } } }; var ue = await graphClient.Me.OnlineMeetings .CreateOrGet(externalId, null, null, participants, null, subject) .Request() .PostAsync(); // await graphClient.Teams.Request().AddAsync(team); // var ue = await graphClient.Me.Request().GetAsync(); Console.WriteLine(ue.JoinWebUrl); } catch (Exception) { throw; } }
public async Task <ActionResult> Post(MeetingParticipants model) { var entity = await _genericRepository.CreateAsync(model); return(new CreatedAtRouteResult("MeetingParticipants", new { id = entity.Id }, entity)); }