Example #1
0
        public async Task <IEnumerable <FamilyDetails> > GetFamiliesDetailsAsync(Guid userId)
        {
            var families = await _familyRepository.GetFamiliesDetailsAsync(userId);

            ResolveFamilyMemberNames(families);
            return(families);
        }
Example #2
0
        public async Task <IActionResult?> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "families/select")] HttpRequest req)
        {
            _logger.LogInformation("C# HTTP trigger function processed a request.");

            var(authenticationStatus, authenticationResponse) = await req.HttpContext.AuthenticateAzureFunctionAsync();

            if (!authenticationStatus)
            {
                return(authenticationResponse);
            }

            var userId   = Guid.Parse(req.HttpContext.User.GetNameIdentifierId() ?? "");
            var families = await _familyRepository.GetFamiliesDetailsAsync(userId);

            var familieyQueryModels = families.Select(_mapper.Map <FamilySelectQueryModel>);

            return(new OkObjectResult(families));
        }