private ValueProviderResult CreateReplacementValueProviderOf(Type typeOfReplacementValueProvider,
                                                                     Type propertyType, ValueProviderResult defaultResult)
        {
            ValueProviderResult replacementValueProvider = null;

            if (typeOfReplacementValueProvider == typeof(EntityValueProviderResult))
            {
                replacementValueProvider = new EntityValueProviderResult(defaultResult, propertyType);
            }
            else if (typeOfReplacementValueProvider == typeof(EntityCollectionValueProviderResult))
            {
                replacementValueProvider = new EntityCollectionValueProviderResult(defaultResult, propertyType);
            }

            Check.Ensure(replacementValueProvider != null, "The desired value provider, " +
                         typeOfReplacementValueProvider.ToString() + ", does not match any custom value provider.");

            return(replacementValueProvider);
        }
        private ValueProviderResult CreateReplacementValueProviderOf(Type typeOfReplacementValueProvider,
            Type propertyType, ValueProviderResult defaultResult)
        {
            ValueProviderResult replacementValueProvider = null;

            if (typeOfReplacementValueProvider == typeof(EntityValueProviderResult)) {
                replacementValueProvider = new EntityValueProviderResult(defaultResult, propertyType);
            }
            else if (typeOfReplacementValueProvider == typeof(EntityCollectionValueProviderResult)) {
                replacementValueProvider = new EntityCollectionValueProviderResult(defaultResult, propertyType);
            }

            Check.Ensure(replacementValueProvider != null, "The desired value provider, " +
                    typeOfReplacementValueProvider.ToString() + ", does not match any custom value provider.");

            return replacementValueProvider;
        }