public async Task <IActionResult> Edit(Color color)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    try
                    {
                        color.IsActive   = true;
                        color.UpdateDate = DateTime.Now;

                        await _colorRepository
                        .UpdateAsync(color);

                        return(RedirectToAction(nameof(Index)));
                    }
                    catch (Exception ex)
                    {
                        if (ex.InnerException.Message.Contains("duplicate"))
                        {
                            if (ModelState.IsValid)
                            {
                                ModelState.AddModelError(string.Empty, $"There is already a color {color.ColorName} registered, please insert another");
                                return(View(color));
                            }
                        }
                        else
                        {
                            ModelState.AddModelError(string.Empty, ex.InnerException.Message);
                            return(View(color));
                        }
                    }
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!await _colorRepository.ExistsAsync(color.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(color));
        }