コード例 #1
0
        public async Task <Response <UserDTO> > SaveNewAvatar(FormImageCreateDTO dto, ClaimsPrincipal claims)
        {
            var imageCreateDTO         = _mapper.Map <FormImageCreateDTO, ImageCreateDTO>(dto);
            var savingResourceResponse = await _resourcesService.CreateImageResource(claims.GetUserId(), FileGroup.Avatar, imageCreateDTO);

            if (!savingResourceResponse.IsSuccess)
            {
                return(ErrorResponse.MapResponse <UserDTO, ResourceImageDTO>(savingResourceResponse));
            }
            return(await _service.SaveNewAvatar(claims.GetUserId(), savingResourceResponse.Data.ResourceId));
        }