//ADD OR CREATE NEW FAVORITE
        public Favorite AddFavorite(Favorite _fav)
        {
            if (_fav != null)
            {
                dbContext.Favorites.Add(_fav);
                dbContext.SaveChanges();
                return(_fav);
            }

            return(null);
        }
Exemple #2
0
        //CREATE OR INSERT NEW USER
        public User AddUser(User _user)
        {
            string hashPass = hashPasword(_user.Pwd);

            if (_user != null)
            {
                _user.Pwd = hashPass;

                dbContext.Users.Add(_user);
                dbContext.SaveChanges();
                return(_user);
            }
            return(null);
        }
Exemple #3
0
 public Vote AddVote(Vote vote_)
 {
     if (vote_ != null)
     {
         dbContext.Votes.Add(vote_);
         dbContext.SaveChanges();
         return(vote_);
     }
     return(null);
 }