コード例 #1
0
        public async Task <IActionResult> AssignSpeakerPinAsync()
        {
            string userPrincipalName = _getUserUniqueId();

            try
            {
                string existingPin = await _persistantStorageService.GetPinBySpeakerAsync(userPrincipalName);

                if (existingPin != null)
                {
                    return(Ok(existingPin));
                }

                string result = await _persistantStorageService.EnrollSpeakerPin(userPrincipalName);

                return(Ok(result));
            }
            catch (Exception e)
            {
                return(StatusCode(400, e.ToString()));
            }
        }