Пример #1
0
        public User Create(string userName)
        {
            if (userName == null) throw new ArgumentNullException("userName");

            var user = new User(_fakeDb.Count.ToString());
            user.UserName = userName;
            _fakeDb.Add(user);
            return user;
        }
Пример #2
0
        public void Save(User user)
        {
            if (user == null) throw new ArgumentNullException("user");

            var dbUser = Get(user.Id);
            if (dbUser == null)
                _fakeDb.Add(user);

            //assume that it's in our list otherwise.
            // remember: fakedb ;)
        }
Пример #3
0
        public void Delete(User user)
        {
            if (user == null) throw new ArgumentNullException("user");

            _fakeDb.RemoveAll(x => x.Id == user.Id);
        }