public async Task <IActionResult> Create([Bind(" ID, UserID, TrailID, UserComment")] UserComments userComments)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userComments);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(userComments));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds a user to the DB
        /// </summary>
        /// <param name="user"> Identifies the user in relation to UserInfo </param>
        /// <returns></returns>
        public async Task AddUser(UserInfo user)
        {
            await _context.AddAsync(user);

            await _context.SaveChangesAsync();
        }
Ejemplo n.º 3
0
        public async Task AddComment(UserComments userComment)
        {
            await _context.UserComments.AddAsync(userComment);

            await _context.SaveChangesAsync();
        }