Пример #1
0
        public long InsertUser(User user)
        {
            var newuser = new Users();
            newuser.userName = user.UserName;

            //Check facebookid
            var facebookUser = user as FacebookUser;
            if (facebookUser != null)
                newuser.facebookId = facebookUser.FacebookUserId;

            _data.Users.AddObject(newuser);
            _data.SaveChanges();

            return newuser.userId;
        }
Пример #2
0
        public long InsertUser(User user)
        {
            long id = 0;
            if (_users.Any())
                id = _users.Max(s => s.UserId) + 1;
            user.UserId = id;

            _users.Add(user);

            return user.UserId;
        }