コード例 #1
0
        public async Task <IActionResult> GetPhonebook(int doctorId)
        {
            if (doctorId != int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value))
            {
                return(Unauthorized("Пользователь не авторизован"));
            }

            var phonebook = await _phonebookService.GetPhonebookAsync();

            var phonebookForReturn = _mapper.Map <IEnumerable <DepartmentWithDoctorsDto> >(phonebook);

            return(Ok(phonebookForReturn));
        }