public IActionResult EditUser(User user)
        {
            if (user.Id == 0)

            {
                _bdc.Add(user);
            }
            else
            {
                _bdc.Update(user);
            }

            _bdc.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public IActionResult Put([FromBody] string term, User user)
        {
            var dbu = _bdc.Users.SingleOrDefault(u => u.FullName == term);

            if (dbu != null)

            {
                //dbu.Activities = term.Activities;
                _bdc.Update(dbu);
                _bdc.SaveChanges();
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }