Whats wrong with this code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;

namespace Assignment_4
{
    public class HashMap<K, V>
    {
        /* Properties */

        public Entry<K, V>[] Table { get; set; }
        public int Capacity { get; set; }
        public double LoadFactor { get; set; }
        public int size; // Field used since we need a Size() method to satisfy the tests.

        /* Constructors */

        public HashMap()
        {
            this.Capacity = 11;
            this.Table = new Entry<K, V>[this.Capacity];
            this.LoadFactor = 0.75;
            this.size = 0;
        }

        public HashMap(int initialCapacity)
        {
            if (initialCapacity <= 0)
            {
                throw new ArgumentException();
            }

            this.Capacity = initialCapacity;
            this.Table = new Entry<K, V>[this.Capacity];
            this.LoadFactor = 0.75;
            this.size = 0;
        }

        public HashMap(int initialCapacity, double loadFactor)
        {
            if (initialCapacity <= 0 || loadFactor <= 0)
            {
                throw new ArgumentException();
            }

            this.Capacity = initialCapacity;
            this.Table = new Entry<K, V>[this.Capacity];
            this.LoadFactor = loadFactor;
            this.size = 0;
        }

        /* Methods */

        public int Size()
        {
            return this.size;
        }

        public bool IsEmpty()
        {
            return this.size == 0;
        }

        public void Clear()
        {
            Array.Clear(this.Table, 0, this.Table.Length);
            this.size = 0;
        }

        public int GetMatchingOrNextAvailableBucket(K key)
        {
            int startPosition = key.GetHashCode() % this.Table.Length;

            for (int i = 0; i < this.Capacity; i++)
            {
                int bucket = (startPosition + i) % this.Capacity;

                if (this.Table[bucket] == null || this.Table[bucket].Key.Equals(key))
                {
                    return bucket;
                }
            }

            throw new InvalidOperationException("“No available bucket found.");
        }

        public V Get(K key)
        {
            if (key == null)
            {
                throw new ArgumentNullException();
            }

            int bucket = GetMatchingOrNextAvailableBucket(key);

            if (this.Table[bucket] != null && this.Table[bucket].Key.Equals(key))
            {
                return this.Table[bucket].Value;
            }
            else
            {
                return default(V); // If no matching key is found, return the default value of the V type (usually null for reference types).
            }
        }

        public V Put(K key, V value)
        {
            if (key == null)
            {
                throw new ArgumentNullException();
            }
            if (value == null)
            {
                throw new ArgumentNullException();
            }

            if (Size() >= this.Capacity * this.LoadFactor)
            {
                ReHash();
            }

            int bucket = GetMatchingOrNextAvailableBucket(key);

            for (Entry<K, V> entry = this.Table[bucket]; entry != null; entry = entry.Next)
            {
                if (entry.Key.Equals(key))
                {
                    V oldValue = entry.Value;
                    entry.Value = value;

                    return oldValue;
                }
            }

            Entry<K, V> newEntry = new Entry<K, V>(key, value);
            newEntry.Next = this.Table[bucket];
            this.Table[bucket] = newEntry;
            this.size++;

            return default(V);
        }

        //public V Remove(K key)
        //{

        //}

        private int ReSize()
        {
            int newCapacity = this.Capacity * 2;

            while (!IsPrime(newCapacity))
            {
                newCapacity++;
            }

            return newCapacity;
        }

        public void ReHash()
        {
            Entry<K, V>[] oldTable = this.Table;
            this.Capacity = ReSize(); // Update Capacity with the next appropriate prime number.
            this.Table = new Entry<K, V>[this.Capacity]; // Create a new table with the updated Capacity.
            this.size = 0; // Reset the size to 0 as we’ll be adding back all the elements.

            // Rehash the entire hash map by iterating through the old table.
            for (int i = 0; i < oldTable.Length; i++)
            {
                Entry<K, V> entry = oldTable[i];
                while (entry != null)
                {
                    Put(entry.Key, entry.Value); // Add to the new table.
                    entry = entry.Next;
                }
            }
        }

        //public IEnumerator<V> Values()
        //{

        //}

        //public IEnumerator<K> Keys()
        //{

        //}

        private bool IsPrime(int number)
        {
            if (number <= 1) return false;
            if (number == 2 || number == 3) return true;

            if (number % 2 == 0) return false;

            for (int i = 3; i * i <= number; i += 2)
            {
                if (number % i == 0) return false;
            }

            return true;
        }
    }
}


it uses these classes:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Assignment_4
{
    public class Entry<K, V>
    {
        /* Properties */

        public K Key { get; set; }
        public V Value { get; set; }
        public Entry<K, V> Next { get; set; } // Used for the next entry in HashMap.cs

        /* Constructors */

        public Entry(K key, V value)
        {
            this.Key = key;
            this.Value = value;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Assignment_4
{
    public class StringKey : IComparable<StringKey>
    {
        /* Properties */

        public string KeyName { get; set; }

        /* Constructors */

        /// <summary>
        /// Initializes property KeyName.
        /// </summary>
        /// <param name="KeyName"></param>
        public StringKey(String KeyName)
        {
            this.KeyName = KeyName;
        }

        /* Methods */

        /// <summary>
        /// Takes an object as a parameter, checks if it’s an instance of the StringKey class, and compares its KeyName property to the current StringKey object’s KeyName property.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object? obj)
        {
            if (obj == null || GetType() != obj.GetType()) // Null and data type check
            {
                return false;
            }

            StringKey stringKeyObj = (StringKey)obj; // Store obj as a string key type

            return this.KeyName == stringKeyObj.KeyName;
        }

        /// <summary>
        /// Accepts a StringKey object as a parameter and compares the KeyName property of the two StringKey objects.
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public int CompareTo(StringKey obj)
        {
            if (obj == null)
            {
                return 1;
            }

            return this.KeyName.CompareTo(obj.KeyName);
        }

        /// <summary>
        /// Specific formatting for string output.
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return $"KeyName: {this.KeyName} HashCode: {GetHashCode()}";
        }

        /// <summary>
        /// Generates a unique hash code for the StringKey object based on its KeyName property.
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int hash = 0;
            int coefficient = 31;

            for (int i = 0; i < this.KeyName.Length; i++) // Iterate through each character in the KeyName string
            {
                int characterIndex = this.KeyName[i];
                int coefficientIndex = (int)Math.Pow(coefficient, i); // Raise the coefficient to the power of the current index (i) in the loop
                hash += characterIndex * coefficientIndex; // Multiply the character index by its respective power of the coefficient and add the result as the hash code.
            }

            return Math.Abs(hash); // Converted to positive number
        }
    }
}