Пример #1
0
        public async Task <IActionResult> AvatarUpdate(int id, ContactAvatarUpdateViewModel model)
        {
            byte[] newAvatarImage = null;
            using (var memoryStream = new MemoryStream())
            {
                await model.NewAvatar.CopyToAsync(memoryStream);

                newAvatarImage = memoryStream.ToArray();
            }

            _contactDabase.AvatarUpdate(id, newAvatarImage);

            return(RedirectToAction("Detail", new { Id = id }));
        }