示例#1
0
        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));
        }