public async Task <IActionResult> Create([Bind("Make,Model")] Car car)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var carToAdd = new Car
                    {
                        Make         = car.Make,
                        Model        = car.Model,
                        AspNetUserId = _userManager.GetUserId(HttpContext.User)
                    };

                    await _context.AddAsync(carToAdd);

                    await _context.SaveChangesAsync();

                    return(RedirectToAction(nameof(Index)));
                }
            }
            catch (DbUpdateException /* ex */)
            {
                //Log the error (uncomment ex variable name and write a log.
                ModelState.AddModelError("", "Unable to save changes. " +
                                         "Try again, and if the problem persists " +
                                         "see your system administrator.");
            }
            return(View(car));
        }
        public async Task <IActionResult> Create([Bind("Text,CarId")] Comment comment)
        {
            comment.Car = await _context.Cars.SingleOrDefaultAsync(c => c.CarId == comment.CarId); // Add car to the comment (does not work)

            try
            {
                if (ModelState.IsValid)
                {
                    await _context.AddAsync(comment);

                    await _context.SaveChangesAsync();

                    return(Redirect("/LoggedIn/Details/" + comment.CarId));
                }
            }
            catch (DbUpdateException /* ex */)
            {
                //Log the error (uncomment ex variable name and write a log.
                ModelState.AddModelError("", "Unable to save changes. " +
                                         "Try again, and if the problem persists " +
                                         "see your system administrator.");
            }
            return(View("/LoggedIn/Details/" + comment.CarId));
        }