Beispiel #1
0
        public async Task <bool> ChangeImage(AccountViewModel input, string id)
        {
            using (var memoryStream = new MemoryStream())
            {
                await input.NewImage.CopyToAsync(memoryStream);

                var img = new AccountImage
                {
                    Img    = memoryStream.ToArray(),
                    UserId = id,
                };

                _userRepo.AddImage(img, id);

                return(true);
            }
        }