public async Task <ResponseDto> UploadPhotoAsync(PhotoDto photo)
        {
            var input = new UploadPhotoInput()
            {
                Extension = photo.Extension,
                Name      = photo.Name,
                Size      = photo.FileSize,
                UserEmail = photo.UserEmail
            };

            var response = await _client.UploadPhotoAsync(input);

            return(new ResponseDto()
            {
                Message = response.Message,
                Status = response.Status,
            });
        }
Пример #2
0
        public override Task <ResponseMessage> UploadPhoto(UploadPhotoInput request, ServerCallContext context)
        {
            var user = new User()
            {
                Email = request.UserEmail,
            };
            var photo = new Photo()
            {
                Name      = request.Name,
                Extension = request.Extension,
                FileSize  = request.Size,
                User      = user
            };

            _photoRepository.UploadPhoto(user, photo);

            return(Task.FromResult(new ResponseMessage
            {
                Status = "Ok",
                Message = "Imagen agregada satisfactoriamente",
            }));
        }