Ejemplo n.º 1
0
        // and so on

        public Property(string address, RealEstateAgent realEstateAgent)
        {
            if (string.IsNullOrWhiteSpace(address))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(address));
            }

            Address         = address;
            RealEstateAgent = realEstateAgent ?? throw new ArgumentNullException(nameof(realEstateAgent));
        }
Ejemplo n.º 2
0
        public override bool Equals(object another)
        {
            if (another == null)
            {
                return(false);
            }

            if (another.GetType() != GetType())
            {
                return(false);
            }

            RealEstateAgent anotherAgent = (RealEstateAgent)another;

            return(Id == anotherAgent.Id && Name == anotherAgent.Name);
        }