public async Task <IActionResult> GetAllAsync()
        {
            var userId = int.Parse(User.FindFirst(ClaimTypes.NameIdentifier)?.Value);
            var result = await _exerciseService.GetAllAsync(userId);

            if (result.ErrorOccurred)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
 public async Task <IHttpActionResult> GetAllAsync()
 {
     return(Ok(await _exerciseService.GetAllAsync()));
 }
Esempio n. 3
0
 public async Task <PageResultDto <ExerciseDto> > HandleAsync(GetExercises query)
 {
     return(await _exerciseService.GetAllAsync(query.Name, query.PartOfBody,
                                               new PaginationQuery(query.PageNumber, query.PageSize)));
 }