public async Task <IActionResult> UploadPicture(UploadPictureViewModel model, List <IFormFile> files)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            var user = await _userManager.GetUserAsync(User);

            // var profile = _context.User.Where(s => s.Id == user.Id).SingleOrDefault();
            foreach (var formFile in files)
            {
                model.ProfilePicture.Add(formFile);
                if (formFile.Length > 0)
                {
                    using (var memoryStream = new MemoryStream())
                    {
                        var file = model.ProfilePicture[0];
                        await file.CopyToAsync(memoryStream);

                        user.ProfilePicture = memoryStream.ToArray();
                    }

                    await _context.SaveChangesAsync();
                }
            }

            return(RedirectToAction(nameof(Index)));
        }
        public async Task <IActionResult> UploadPicture()
        {
            var user = await _userManager.GetUserAsync(User);

            if (user == null)
            {
                throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
            }

            var model = new UploadPictureViewModel
            {
            };

            return(View(model));
        }