public async Task <IActionResult> Upload(ImageUpload image)
        {
            if (image != null && image.File != null)
            {
                var    filePath = Path.GetTempFileName();
                byte[] byteArray;

                if (image.File.Length > 0)
                {
                    using (var stream = new FileStream(filePath, FileMode.Create))
                    {
                        image.File.CopyTo(stream);
                    }

                    using (MemoryStream ms = new MemoryStream())
                    {
                        image.File.CopyTo(ms);
                        byteArray = ms.ToArray();
                    }

                    var categories = await _categoriesRepository.GetById(image.CategoryId);

                    categories.Picture = (new byte[78]).Concat(byteArray).ToArray();

                    try
                    {
                        await _categoriesRepository.Update(categories);
                    }
                    catch (DbUpdateConcurrencyException)
                    {
                        if (!_categoriesRepository.CategoriesExists(categories.CategoryId))
                        {
                            return(NotFound());
                        }
                        else
                        {
                            throw;
                        }
                    }
                }
            }

            return(RedirectToAction(nameof(Index)));
        }