protected EntityProxy(EntityId entityId, Client client, ResponseDictionary responseDictionary)
 {
     _entityId = entityId;
     _client = client;
     _responseDictionary = responseDictionary;
     this.IsLoaded = false;
 }
        protected Association(EntityId entityId, ResponseDictionary responseDictionary,
            DateTime? contactCreationDate)
        {
            EntityId = entityId;
            _responseDictionary = responseDictionary;
            ContactCreationDate = contactCreationDate;

            ValidateEntityIdType();
        }
        public IPerson GetPerson(EntityId entityId)
        {
            if (_personDictionary.ContainsKey(entityId))
            {
                return _personDictionary[entityId];
            }

            IPerson proxy = new PersonProxy(entityId, _client, this);
            _personDictionary.Add(entityId, proxy);
            return proxy;
        }
        protected Association(EntityId entityId, ResponseDictionary responseDictionary, TimePeriod validFor, bool isHistorical,
            DateTime? contactCreationDate)
        {
            EntityId = entityId;
            _responseDictionary = responseDictionary;
            ValidFor = validFor;
            IsHistorical = isHistorical;
            ContactCreationDate = contactCreationDate;

            ValidateEntityIdType();
        }
        public IBusiness GetBusiness(EntityId entityId)
        {
            if (_businessDictionary.ContainsKey(entityId))
            {
                return _businessDictionary[entityId];
            }

            IBusiness proxy = new BusinessProxy(entityId, _client, this);
            _businessDictionary.Add(entityId, proxy);
            return proxy;
        }
        public ILocation GetLocation(EntityId entityId)
        {
            if (_locationDictionary.ContainsKey(entityId))
            {
                return _locationDictionary[entityId];
            }

            ILocation proxy = new LocationProxy(entityId, _client, this);
            _locationDictionary.Add(entityId, proxy);
            return proxy;
        }
 protected BaseEntity(EntityId entityId)
 {
     this.Id = entityId;
 }
		public PersonAssociation(EntityId entityId, ResponseDictionary responseDictionary)
			: base(entityId, responseDictionary)
		{

		}
		public LocationQuery(EntityId entityId)
			: base(entityId)
		{
			
		}
		public PhoneLiteQuery(EntityId entityId) : base(entityId)
		{
			this.ResponseType = PhoneResponseType.Lite;
		}
		public BusinessProxy(EntityId entityId, Client client, ResponseDictionary responseDictionary)
			: base(entityId, client, responseDictionary)
		{

		}
 protected Association(EntityId entityId, ResponseDictionary responseDictionary)
     : this(entityId, responseDictionary, null, false, null)
 {
 }
		protected SerializableAssociation(EntityId entityId, ResponseDictionary responseDictionary, DateTime? contactCreationDate)
			: base(entityId, responseDictionary, contactCreationDate)
		{

		}
		protected SerializableAssociation(EntityId entityId, ResponseDictionary responseDictionary)
			: base(entityId, responseDictionary)
		{
			
		}
		protected LegalEntityAssociation(EntityId entityId, ResponseDictionary responseDictionary)
			: base(entityId, responseDictionary)
		{

		}
        public bool Equals(EntityId id)
        {
            if (this == id)
            {
                return true;
            }
            if ((id == null) || this.GetType() != id.GetType())
            {
                return false;
            }

            if ((this.Type != id.Type) || (this.Guid != id.Guid))
            {
                return false;
            }

            return true;
        }
 public PersonQuery(EntityId entityId)
     : base(entityId)
 {
 }
		public BusinessQuery(EntityId id) : base(id)
		{
			
		}
        public IPhone GetPhone(EntityId entityId)
        {
            if (_phoneDictionary.ContainsKey(entityId))
            {
                return _phoneDictionary[entityId];
            }

            IPhone proxy = new PhoneProxy(entityId, _client, this);
            _phoneDictionary.Add(entityId, proxy);
            return proxy;
        }
 protected WhereQuery(EntityId entityId)
     : base(entityId)
 {
 }
 protected LocationAssociation(EntityId entityId, ResponseDictionary responseDictionary, TimePeriod validFor,
     bool isHistorical, DateTime? contactCreationDate)
     : base(entityId, responseDictionary, validFor, isHistorical, contactCreationDate)
 {
 }
		protected LegalEntity(EntityId entityId) : base(entityId)
		{
			
		}
 public Phone(EntityId entityId)
     : base(entityId)
 {
 }
		public PhoneQuery(EntityId entityId)
			: base(entityId)
		{

		}
 public Person(EntityId entityId)
     : base(entityId)
 {
 }
		public BusinessAssociation(EntityId entityId, ResponseDictionary responseDictionary)
			: base(entityId, responseDictionary)
		{

		}
		public PersonAssociation(EntityId entityId, ResponseDictionary responseDictionary,
								   DateTime? contactCreationDate)
			: base(entityId, responseDictionary, contactCreationDate)
		{

		}
 public Business(EntityId entityId)
     : base(entityId)
 {
 }
 public PhoneProxy(EntityId entityId, Client client, ResponseDictionary responseDictionary)
     : base(entityId, client, responseDictionary)
 {
 }
		protected EntityQuery(EntityId id)
		{
			this.Id = id;
		}