private object Initialize(EntityDataSourceWrapper entity)
        {
            // get parent's value
            object parentObjectValue = GetParentObjectValue(entity, true /* initialize */);

            // construct type instance for this property
            object propertyValue = EntityDataSourceUtil.InitializeType(this.ClrType);

            // set property
            this.propertyInfo.SetValue(parentObjectValue, propertyValue, new object[] { });

            return propertyValue;
        }
        private object GetParentObjectValue(EntityDataSourceWrapper entity, bool initialize)
        {
            // get parent's value
            object parentObjectValue;

            if (null == this.parent)
            {
                // at the top level, the entity is the value
                parentObjectValue = entity.WrappedEntity;
            }
            else
            {
                parentObjectValue = this.parent.GetValue(entity);

                if (null == parentObjectValue && initialize)
                {
                    parentObjectValue = this.parent.Initialize(entity);
                }
            }

            return parentObjectValue;
        }
        internal object GetValue(EntityDataSourceWrapper entity)
        {
            object parentObjectValue = GetParentObjectValue(entity, false /* initialize */); 
            if (null == parentObjectValue)
            {
                // use convention that property of null is null
                return null;
            }
            else
            {
                // get this property
                object propertyValue = this.propertyInfo.GetValue(parentObjectValue, new object[] { });

                return propertyValue;
            }
        }
        internal void SetValue(EntityDataSourceWrapper entity, object value)
        {
            object parentObjectValue = GetParentObjectValue(entity, true /* initialize */);

            // set property value on parent
            this.propertyInfo.SetValue(parentObjectValue, value, new object[] { });
        }
 internal override object GetValue(EntityDataSourceWrapper entity)
 {
     EntityKey entityKey = this.Group.GetEntityKey(entity);
     if (null == entityKey)
     {
         return null;
     }
     else
     {
         object value = null;
         // loop through to find the correct keymember, take compound key into consideration
         foreach (EntityKeyMember entityKeyValue in entityKey.EntityKeyValues)
         {
             if (entityKeyValue.Key == this.KeyMember.Name)
             {
                 value = entityKeyValue.Value;
             }
         }
         return value;
     }
 }
 internal override void SetValue(EntityDataSourceWrapper entity, object value)
 {
     throw new InvalidOperationException(Strings.SetValueNotSupported);
 }
 override internal object GetValue(EntityDataSourceWrapper entity)
 {
     return this.memberPath.GetValue(entity);
 }
 override internal void SetValue(EntityDataSourceWrapper entity, object value)
 {
     this.memberPath.SetValue(entity, value);
 }
 internal abstract void SetValue(EntityDataSourceWrapper entity, object value);
 internal abstract object GetValue(EntityDataSourceWrapper entity);
 internal EntityDataSourceWrapper AddWrappedEntity(object entity)
 {
     EntityDataSourceWrapper wrapper = new EntityDataSourceWrapper(this, entity);
     this._wrapperList.Add(wrapper);
     return wrapper;
 }
 internal abstract EntityKey GetEntityKey(EntityDataSourceWrapper entity);
 internal abstract void SetKeyValues(EntityDataSourceWrapper wrapper, Dictionary<string, object> newKeyValues);