示例#1
0
        public async Task <IActionResult> GetUserRecipes()
        {
            var userId = Guid.Parse(User.FindFirstValue(KnownClaims.UserId));

            if (userId == null)
            {
                return(NotFound());
            }

            var recipes = await recipesService.AllByUserAsync(userId);

            var mappedRecipes = mapper.Map <List <RecipeDTO> >(recipes);

            return(Ok(mappedRecipes));
        }