public async Task <string> GetSpeakerProfileAsync(string userPrincipalName, SpeakerProfileType speakerProfileType) { var existing = await _getSpeakerProfileAsync(userPrincipalName, speakerProfileType); return(existing?.ProfileId); }
private async Task <MappedAuthentication> _getSpeakerProfileAsync(string userPrincipalName, SpeakerProfileType speakerProfileType) { var existing = await _context.UserMaps.FirstOrDefaultAsync(_ => _.UserPrinipleName == userPrincipalName && _.ProfileType == speakerProfileType); return(existing); }
public async Task CreateSpeakerProfileAsync(string userPrincipalName, SpeakerProfileType speakerProfileType, string profileId) { var existing = _context.UserMaps.FirstOrDefault(_ => _.UserPrinipleName == userPrincipalName); if (existing != null) { return; } var newItem = new MappedAuthentication { UserPrinipleName = userPrincipalName, ProfileType = speakerProfileType, ProfileId = profileId }; await _context.AddAsync(newItem); await _context.SaveChangesAsync(); }