예제 #1
0
        // Filtered access: Guest/Admin.
        public async Task <IActionResult> Single([FromRoute] int resourceId)
        {
            await AuthorizeForSingleResource(resourceId);

            var resourceModel = await resService.Get(resourceId);

            var images = resourceModel.Image.Select(x => x.ImagePath).AsEnumerable();

            var resourceDTO = mappService.Map <ResourceMaxDto>(resourceModel);

            resourceDTO.Image = images;

            return(Ok(resourceDTO));
        }
예제 #2
0
        // Filtered access: Guest/Admin.
        public async Task <IActionResult> Single([FromRoute] int resourceId)
        {
            await AuthorizeForSingleResource(resourceId);

            var resourceModel = await resService.Get(resourceId);

            var resourceDTO = mappService.Map <ResourceMaxDto>(resourceModel);

            return(Ok(resourceDTO));
        }
예제 #3
0
 public async Task <IActionResult> Get(Guid id)
 => await ReturnBadRequestIfThrowError(async() => await _resourcesService.Get(id));