public IActionResult Like(int id) { if (Autentification.GetLoggedUser(HttpContext) != null) { Clients c = clientRepository.GetClientByUserId(Autentification.GetLoggedUser(HttpContext).Id); Likes like = new Likes(); like.ArtworkId = id; like.ClientId = c.Id; likesRepository.InsertLike(like); likesRepository.Save(); return(RedirectToAction("Index", "Artwork")); } else { return(RedirectToAction("Index", "Autentification")); } }