Example #1
0
        public async Task <IActionResult> Update(int PetID, string Notes)
        {
            var userJSON    = HttpContext.Session.GetString("profile");
            var userProfile = JsonConvert.DeserializeObject <Profile>(userJSON);

            Favorite favorite = new Favorite()
            {
                UserID = userProfile.UserID,
                PetID  = PetID,
                Notes  = Notes
            };

            await _context.UpdateFavorite(favorite);

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