public async Task <IActionResult> GetAllCategoryRelationsAsync([FromQuery] Guid?categoryId) { var relations = categoryId != null ? await _relationService.GetRelationsByCategotyIdAsync(categoryId) : await _relationService.GetAllRelationsAsync(); var resultRelation = _mapper.Map <IEnumerable <Relation>, IEnumerable <GetAllRelationsViewModel> >(relations); return(Ok(resultRelation)); }