Exemplo n.º 1
0
        public async Task <IActionResult> ChangePhoto(IFormCollection collection)
        {
            if (ModelState.IsValid && collection.Files[0] != null)
            {
                await _photoService.ChangePhotoAsync(new AddPhotoDto()
                {
                    UserId       = (int)HttpContext.Items["id"],
                    UploadedFile = collection.Files[0]
                });

                return(Ok());
            }

            return(BadRequest());
        }