Beispiel #1
0
        public int AddUser(UserDTO user)
        {
            UserDAL db = new UserDAL();

            user = _mapper.Map <UserDTO> (db.tblUsers.Add(_mapper.Map <tblUser>(user)));
            db.SaveChanges();

            return(user.userID);
        }
Beispiel #2
0
 public void Update(UserDTO user)
 {
     using (var db = new UserDAL())
     {
         var old = db.tblUsers.FirstOrDefault(u => u.userId == user.userID);
         old.phoneNumber = user.phoneNumber;
         old.isFemale    = user.isFemale;
         old.fullName    = user.fullName;
         old.email       = user.eMail;
         db.SaveChanges();
     }
 }