Пример #1
0
        partial void AddUser(int id, string name)
        {
            int capacity = _users.Count + 1;
            var temp     = new List <SocialNetworkUser>(capacity);

            for (var i = 0; i < temp.Count; i++)
            {
                temp[i] = _users[i];
            }

            try
            {
                temp[capacity] = new SocialNetworkUser(id, name);
            }
            catch (ArgumentOutOfRangeException e)
            {
                Console.WriteLine($"{e.Message}");
                throw;
            }
        }
 public void AddUserMain(SocialNetworkUser user)
 {
     //_users.Add(user);
     AddUser(123, "Khf");
 }